Skip to content

Commit d6f2f98

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 933f6c1 commit d6f2f98

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
@@ -12301,7 +12301,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1230112301
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1230212302
set gitk_libdir [file join $gitk_prefix share gitk lib]
1230312303
set gitk_msgsdir [file join $gitk_libdir msgs]
12304-
unset gitk_prefix
1230512304
}
1230612305

1230712306
## Internationalization (i18n) through msgcat and gettext. See
@@ -12664,28 +12663,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1266412663
set worktree [gitworktree]
1266512664
setcoords
1266612665
makewindow
12667-
catch {
12668-
image create photo gitlogo -width 16 -height 16
12669-
12670-
image create photo gitlogominus -width 4 -height 2
12671-
gitlogominus put #C00000 -to 0 0 4 2
12672-
gitlogo copy gitlogominus -to 1 5
12673-
gitlogo copy gitlogominus -to 6 5
12674-
gitlogo copy gitlogominus -to 11 5
12675-
image delete gitlogominus
12676-
12677-
image create photo gitlogoplus -width 4 -height 4
12678-
gitlogoplus put #008000 -to 1 0 3 4
12679-
gitlogoplus put #008000 -to 0 1 4 3
12680-
gitlogo copy gitlogoplus -to 1 9
12681-
gitlogo copy gitlogoplus -to 6 9
12682-
gitlogo copy gitlogoplus -to 11 9
12683-
image delete gitlogoplus
12684-
12685-
image create photo gitlogo32 -width 32 -height 32
12686-
gitlogo32 copy gitlogo -zoom 2 2
12687-
12688-
wm iconphoto . -default gitlogo gitlogo32
12666+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12667+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12668+
} else {
12669+
catch {
12670+
image create photo gitlogo -width 16 -height 16
12671+
12672+
image create photo gitlogominus -width 4 -height 2
12673+
gitlogominus put #C00000 -to 0 0 4 2
12674+
gitlogo copy gitlogominus -to 1 5
12675+
gitlogo copy gitlogominus -to 6 5
12676+
gitlogo copy gitlogominus -to 11 5
12677+
image delete gitlogominus
12678+
12679+
image create photo gitlogoplus -width 4 -height 4
12680+
gitlogoplus put #008000 -to 1 0 3 4
12681+
gitlogoplus put #008000 -to 0 1 4 3
12682+
gitlogo copy gitlogoplus -to 1 9
12683+
gitlogo copy gitlogoplus -to 6 9
12684+
gitlogo copy gitlogoplus -to 11 9
12685+
image delete gitlogoplus
12686+
12687+
image create photo gitlogo32 -width 32 -height 32
12688+
gitlogo32 copy gitlogo -zoom 2 2
12689+
12690+
wm iconphoto . -default gitlogo gitlogo32
12691+
}
1268912692
}
1269012693
# wait for the window to become visible
1269112694
tkwait visibility .

0 commit comments

Comments
 (0)