Skip to content

Commit 91ddaed

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 71e1741 commit 91ddaed

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

gitk-git/gitk

+26-23
Original file line numberDiff line numberDiff line change
@@ -12275,7 +12275,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1227512275
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1227612276
set gitk_libdir [file join $gitk_prefix share gitk lib]
1227712277
set gitk_msgsdir [file join $gitk_libdir msgs]
12278-
unset gitk_prefix
1227912278
}
1228012279

1228112280
## Internationalization (i18n) through msgcat and gettext. See
@@ -12638,28 +12637,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1263812637
set worktree [gitworktree]
1263912638
setcoords
1264012639
makewindow
12641-
catch {
12642-
image create photo gitlogo -width 16 -height 16
12643-
12644-
image create photo gitlogominus -width 4 -height 2
12645-
gitlogominus put #C00000 -to 0 0 4 2
12646-
gitlogo copy gitlogominus -to 1 5
12647-
gitlogo copy gitlogominus -to 6 5
12648-
gitlogo copy gitlogominus -to 11 5
12649-
image delete gitlogominus
12650-
12651-
image create photo gitlogoplus -width 4 -height 4
12652-
gitlogoplus put #008000 -to 1 0 3 4
12653-
gitlogoplus put #008000 -to 0 1 4 3
12654-
gitlogo copy gitlogoplus -to 1 9
12655-
gitlogo copy gitlogoplus -to 6 9
12656-
gitlogo copy gitlogoplus -to 11 9
12657-
image delete gitlogoplus
12658-
12659-
image create photo gitlogo32 -width 32 -height 32
12660-
gitlogo32 copy gitlogo -zoom 2 2
12661-
12662-
wm iconphoto . -default gitlogo gitlogo32
12640+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12641+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12642+
} else {
12643+
catch {
12644+
image create photo gitlogo -width 16 -height 16
12645+
12646+
image create photo gitlogominus -width 4 -height 2
12647+
gitlogominus put #C00000 -to 0 0 4 2
12648+
gitlogo copy gitlogominus -to 1 5
12649+
gitlogo copy gitlogominus -to 6 5
12650+
gitlogo copy gitlogominus -to 11 5
12651+
image delete gitlogominus
12652+
12653+
image create photo gitlogoplus -width 4 -height 4
12654+
gitlogoplus put #008000 -to 1 0 3 4
12655+
gitlogoplus put #008000 -to 0 1 4 3
12656+
gitlogo copy gitlogoplus -to 1 9
12657+
gitlogo copy gitlogoplus -to 6 9
12658+
gitlogo copy gitlogoplus -to 11 9
12659+
image delete gitlogoplus
12660+
12661+
image create photo gitlogo32 -width 32 -height 32
12662+
gitlogo32 copy gitlogo -zoom 2 2
12663+
12664+
wm iconphoto . -default gitlogo gitlogo32
12665+
}
1266312666
}
1266412667
# wait for the window to become visible
1266512668
tkwait visibility .

0 commit comments

Comments
 (0)