Skip to content

Commit c63b6a7

Browse files
sschuberthnalla
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 d8f76c8 commit c63b6a7

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
@@ -12092,7 +12092,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1209212092
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1209312093
set gitk_libdir [file join $gitk_prefix share gitk lib]
1209412094
set gitk_msgsdir [file join $gitk_libdir msgs]
12095-
unset gitk_prefix
1209612095
}
1209712096

1209812097
## Internationalization (i18n) through msgcat and gettext. See
@@ -12284,28 +12283,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1228412283
set worktree [exec git rev-parse --show-toplevel]
1228512284
setcoords
1228612285
makewindow
12287-
catch {
12288-
image create photo gitlogo -width 16 -height 16
12289-
12290-
image create photo gitlogominus -width 4 -height 2
12291-
gitlogominus put #C00000 -to 0 0 4 2
12292-
gitlogo copy gitlogominus -to 1 5
12293-
gitlogo copy gitlogominus -to 6 5
12294-
gitlogo copy gitlogominus -to 11 5
12295-
image delete gitlogominus
12296-
12297-
image create photo gitlogoplus -width 4 -height 4
12298-
gitlogoplus put #008000 -to 1 0 3 4
12299-
gitlogoplus put #008000 -to 0 1 4 3
12300-
gitlogo copy gitlogoplus -to 1 9
12301-
gitlogo copy gitlogoplus -to 6 9
12302-
gitlogo copy gitlogoplus -to 11 9
12303-
image delete gitlogoplus
12304-
12305-
image create photo gitlogo32 -width 32 -height 32
12306-
gitlogo32 copy gitlogo -zoom 2 2
12307-
12308-
wm iconphoto . -default gitlogo gitlogo32
12286+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12287+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12288+
} else {
12289+
catch {
12290+
image create photo gitlogo -width 16 -height 16
12291+
12292+
image create photo gitlogominus -width 4 -height 2
12293+
gitlogominus put #C00000 -to 0 0 4 2
12294+
gitlogo copy gitlogominus -to 1 5
12295+
gitlogo copy gitlogominus -to 6 5
12296+
gitlogo copy gitlogominus -to 11 5
12297+
image delete gitlogominus
12298+
12299+
image create photo gitlogoplus -width 4 -height 4
12300+
gitlogoplus put #008000 -to 1 0 3 4
12301+
gitlogoplus put #008000 -to 0 1 4 3
12302+
gitlogo copy gitlogoplus -to 1 9
12303+
gitlogo copy gitlogoplus -to 6 9
12304+
gitlogo copy gitlogoplus -to 11 9
12305+
image delete gitlogoplus
12306+
12307+
image create photo gitlogo32 -width 32 -height 32
12308+
gitlogo32 copy gitlogo -zoom 2 2
12309+
12310+
wm iconphoto . -default gitlogo gitlogo32
12311+
}
1230912312
}
1231012313
# wait for the window to become visible
1231112314
tkwait visibility .

0 commit comments

Comments
 (0)