Skip to content

Commit af746bd

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 493c22b commit af746bd

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
@@ -12192,7 +12192,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1219212192
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1219312193
set gitk_libdir [file join $gitk_prefix share gitk lib]
1219412194
set gitk_msgsdir [file join $gitk_libdir msgs]
12195-
unset gitk_prefix
1219612195
}
1219712196

1219812197
## Internationalization (i18n) through msgcat and gettext. See
@@ -12547,28 +12546,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1254712546
set worktree [exec git rev-parse --show-toplevel]
1254812547
setcoords
1254912548
makewindow
12550-
catch {
12551-
image create photo gitlogo -width 16 -height 16
12552-
12553-
image create photo gitlogominus -width 4 -height 2
12554-
gitlogominus put #C00000 -to 0 0 4 2
12555-
gitlogo copy gitlogominus -to 1 5
12556-
gitlogo copy gitlogominus -to 6 5
12557-
gitlogo copy gitlogominus -to 11 5
12558-
image delete gitlogominus
12559-
12560-
image create photo gitlogoplus -width 4 -height 4
12561-
gitlogoplus put #008000 -to 1 0 3 4
12562-
gitlogoplus put #008000 -to 0 1 4 3
12563-
gitlogo copy gitlogoplus -to 1 9
12564-
gitlogo copy gitlogoplus -to 6 9
12565-
gitlogo copy gitlogoplus -to 11 9
12566-
image delete gitlogoplus
12567-
12568-
image create photo gitlogo32 -width 32 -height 32
12569-
gitlogo32 copy gitlogo -zoom 2 2
12570-
12571-
wm iconphoto . -default gitlogo gitlogo32
12549+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12550+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12551+
} else {
12552+
catch {
12553+
image create photo gitlogo -width 16 -height 16
12554+
12555+
image create photo gitlogominus -width 4 -height 2
12556+
gitlogominus put #C00000 -to 0 0 4 2
12557+
gitlogo copy gitlogominus -to 1 5
12558+
gitlogo copy gitlogominus -to 6 5
12559+
gitlogo copy gitlogominus -to 11 5
12560+
image delete gitlogominus
12561+
12562+
image create photo gitlogoplus -width 4 -height 4
12563+
gitlogoplus put #008000 -to 1 0 3 4
12564+
gitlogoplus put #008000 -to 0 1 4 3
12565+
gitlogo copy gitlogoplus -to 1 9
12566+
gitlogo copy gitlogoplus -to 6 9
12567+
gitlogo copy gitlogoplus -to 11 9
12568+
image delete gitlogoplus
12569+
12570+
image create photo gitlogo32 -width 32 -height 32
12571+
gitlogo32 copy gitlogo -zoom 2 2
12572+
12573+
wm iconphoto . -default gitlogo gitlogo32
12574+
}
1257212575
}
1257312576
# wait for the window to become visible
1257412577
tkwait visibility .

0 commit comments

Comments
 (0)