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 <sschuberth@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Sebastian Schuberth committed Jul 22, 2012 at 23:19 UTC baaa9d6d8688ac1787e4be6087173c9e4341b162
1 file changed +26 -23
gitk
+26 -23
@@ -12471,7 +12471,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
12471 set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
12472 set gitk_libdir [file join $gitk_prefix share gitk lib]
12473 set gitk_msgsdir [file join $gitk_libdir msgs]
12474 - unset gitk_prefix
12474 }
12475
12476 ## Internationalization (i18n) through msgcat and gettext. See
@@ -12837,28 +12836,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
12836 set worktree [gitworktree]
12837 setcoords
12838 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 + }
12865 }
12866 # wait for the window to become visible
12867 if {![winfo viewable .]} {tkwait visibility .}