Skip to content

Commit 06749af

Browse files
sschuberthdscho
authored andcommitted
gitk: Use an external icon file on Windows
Git for Windows now ships with the new Git icon from git-scm.com. Use that icon file if it exists instead of the old procedurally drawn one. This patch was sent upstream but so far no decision on its inclusion was made, so commit it to our fork. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 043a55c commit 06749af

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

gitk-git/gitk

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12208,7 +12208,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1220812208
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1220912209
set gitk_libdir [file join $gitk_prefix share gitk lib]
1221012210
set gitk_msgsdir [file join $gitk_libdir msgs]
12211-
unset gitk_prefix
1221212211
}
1221312212

1221412213
## Internationalization (i18n) through msgcat and gettext. See
@@ -12563,28 +12562,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1256312562
set worktree [exec git rev-parse --show-toplevel]
1256412563
setcoords
1256512564
makewindow
12566-
catch {
12567-
image create photo gitlogo -width 16 -height 16
12568-
12569-
image create photo gitlogominus -width 4 -height 2
12570-
gitlogominus put #C00000 -to 0 0 4 2
12571-
gitlogo copy gitlogominus -to 1 5
12572-
gitlogo copy gitlogominus -to 6 5
12573-
gitlogo copy gitlogominus -to 11 5
12574-
image delete gitlogominus
12575-
12576-
image create photo gitlogoplus -width 4 -height 4
12577-
gitlogoplus put #008000 -to 1 0 3 4
12578-
gitlogoplus put #008000 -to 0 1 4 3
12579-
gitlogo copy gitlogoplus -to 1 9
12580-
gitlogo copy gitlogoplus -to 6 9
12581-
gitlogo copy gitlogoplus -to 11 9
12582-
image delete gitlogoplus
12583-
12584-
image create photo gitlogo32 -width 32 -height 32
12585-
gitlogo32 copy gitlogo -zoom 2 2
12586-
12587-
wm iconphoto . -default gitlogo gitlogo32
12565+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12566+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12567+
} else {
12568+
catch {
12569+
image create photo gitlogo -width 16 -height 16
12570+
12571+
image create photo gitlogominus -width 4 -height 2
12572+
gitlogominus put #C00000 -to 0 0 4 2
12573+
gitlogo copy gitlogominus -to 1 5
12574+
gitlogo copy gitlogominus -to 6 5
12575+
gitlogo copy gitlogominus -to 11 5
12576+
image delete gitlogominus
12577+
12578+
image create photo gitlogoplus -width 4 -height 4
12579+
gitlogoplus put #008000 -to 1 0 3 4
12580+
gitlogoplus put #008000 -to 0 1 4 3
12581+
gitlogo copy gitlogoplus -to 1 9
12582+
gitlogo copy gitlogoplus -to 6 9
12583+
gitlogo copy gitlogoplus -to 11 9
12584+
image delete gitlogoplus
12585+
12586+
image create photo gitlogo32 -width 32 -height 32
12587+
gitlogo32 copy gitlogo -zoom 2 2
12588+
12589+
wm iconphoto . -default gitlogo gitlogo32
12590+
}
1258812591
}
1258912592
# wait for the window to become visible
1259012593
tkwait visibility .

0 commit comments

Comments
 (0)