Skip to content

Commit 18b73ac

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 28999e7 commit 18b73ac

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
@@ -12075,7 +12075,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1207512075
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1207612076
set gitk_libdir [file join $gitk_prefix share gitk lib]
1207712077
set gitk_msgsdir [file join $gitk_libdir msgs]
12078-
unset gitk_prefix
1207912078
}
1208012079

1208112080
## Internationalization (i18n) through msgcat and gettext. See
@@ -12426,28 +12425,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1242612425
set worktree [exec git rev-parse --show-toplevel]
1242712426
setcoords
1242812427
makewindow
12429-
catch {
12430-
image create photo gitlogo -width 16 -height 16
12431-
12432-
image create photo gitlogominus -width 4 -height 2
12433-
gitlogominus put #C00000 -to 0 0 4 2
12434-
gitlogo copy gitlogominus -to 1 5
12435-
gitlogo copy gitlogominus -to 6 5
12436-
gitlogo copy gitlogominus -to 11 5
12437-
image delete gitlogominus
12438-
12439-
image create photo gitlogoplus -width 4 -height 4
12440-
gitlogoplus put #008000 -to 1 0 3 4
12441-
gitlogoplus put #008000 -to 0 1 4 3
12442-
gitlogo copy gitlogoplus -to 1 9
12443-
gitlogo copy gitlogoplus -to 6 9
12444-
gitlogo copy gitlogoplus -to 11 9
12445-
image delete gitlogoplus
12446-
12447-
image create photo gitlogo32 -width 32 -height 32
12448-
gitlogo32 copy gitlogo -zoom 2 2
12449-
12450-
wm iconphoto . -default gitlogo gitlogo32
12428+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12429+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12430+
} else {
12431+
catch {
12432+
image create photo gitlogo -width 16 -height 16
12433+
12434+
image create photo gitlogominus -width 4 -height 2
12435+
gitlogominus put #C00000 -to 0 0 4 2
12436+
gitlogo copy gitlogominus -to 1 5
12437+
gitlogo copy gitlogominus -to 6 5
12438+
gitlogo copy gitlogominus -to 11 5
12439+
image delete gitlogominus
12440+
12441+
image create photo gitlogoplus -width 4 -height 4
12442+
gitlogoplus put #008000 -to 1 0 3 4
12443+
gitlogoplus put #008000 -to 0 1 4 3
12444+
gitlogo copy gitlogoplus -to 1 9
12445+
gitlogo copy gitlogoplus -to 6 9
12446+
gitlogo copy gitlogoplus -to 11 9
12447+
image delete gitlogoplus
12448+
12449+
image create photo gitlogo32 -width 32 -height 32
12450+
gitlogo32 copy gitlogo -zoom 2 2
12451+
12452+
wm iconphoto . -default gitlogo gitlogo32
12453+
}
1245112454
}
1245212455
# wait for the window to become visible
1245312456
tkwait visibility .

0 commit comments

Comments
 (0)