Skip to content

Commit 2891686

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 53bc672 commit 2891686

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
@@ -12471,7 +12471,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1247112471
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1247212472
set gitk_libdir [file join $gitk_prefix share gitk lib]
1247312473
set gitk_msgsdir [file join $gitk_libdir msgs]
12474-
unset gitk_prefix
1247512474
}
1247612475
1247712476
## Internationalization (i18n) through msgcat and gettext. See
@@ -12837,28 +12836,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1283712836
set worktree [gitworktree]
1283812837
setcoords
1283912838
makewindow
12840-
catch {
12841-
image create photo gitlogo -width 16 -height 16
12842-
12843-
image create photo gitlogominus -width 4 -height 2
12844-
gitlogominus put #C00000 -to 0 0 4 2
12845-
gitlogo copy gitlogominus -to 1 5
12846-
gitlogo copy gitlogominus -to 6 5
12847-
gitlogo copy gitlogominus -to 11 5
12848-
image delete gitlogominus
12849-
12850-
image create photo gitlogoplus -width 4 -height 4
12851-
gitlogoplus put #008000 -to 1 0 3 4
12852-
gitlogoplus put #008000 -to 0 1 4 3
12853-
gitlogo copy gitlogoplus -to 1 9
12854-
gitlogo copy gitlogoplus -to 6 9
12855-
gitlogo copy gitlogoplus -to 11 9
12856-
image delete gitlogoplus
12857-
12858-
image create photo gitlogo32 -width 32 -height 32
12859-
gitlogo32 copy gitlogo -zoom 2 2
12860-
12861-
wm iconphoto . -default gitlogo gitlogo32
12839+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12840+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12841+
} else {
12842+
catch {
12843+
image create photo gitlogo -width 16 -height 16
12844+
12845+
image create photo gitlogominus -width 4 -height 2
12846+
gitlogominus put #C00000 -to 0 0 4 2
12847+
gitlogo copy gitlogominus -to 1 5
12848+
gitlogo copy gitlogominus -to 6 5
12849+
gitlogo copy gitlogominus -to 11 5
12850+
image delete gitlogominus
12851+
12852+
image create photo gitlogoplus -width 4 -height 4
12853+
gitlogoplus put #008000 -to 1 0 3 4
12854+
gitlogoplus put #008000 -to 0 1 4 3
12855+
gitlogo copy gitlogoplus -to 1 9
12856+
gitlogo copy gitlogoplus -to 6 9
12857+
gitlogo copy gitlogoplus -to 11 9
12858+
image delete gitlogoplus
12859+
12860+
image create photo gitlogo32 -width 32 -height 32
12861+
gitlogo32 copy gitlogo -zoom 2 2
12862+
12863+
wm iconphoto . -default gitlogo gitlogo32
12864+
}
1286212865
}
1286312866
# wait for the window to become visible
1286412867
if {![winfo viewable .]} {tkwait visibility .}

0 commit comments

Comments
 (0)