Skip to content

Commit 02860c5

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 e07d36d commit 02860c5

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

1209912098
## Internationalization (i18n) through msgcat and gettext. See
@@ -12448,28 +12447,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1244812447
set worktree [exec git rev-parse --show-toplevel]
1244912448
setcoords
1245012449
makewindow
12451-
catch {
12452-
image create photo gitlogo -width 16 -height 16
12453-
12454-
image create photo gitlogominus -width 4 -height 2
12455-
gitlogominus put #C00000 -to 0 0 4 2
12456-
gitlogo copy gitlogominus -to 1 5
12457-
gitlogo copy gitlogominus -to 6 5
12458-
gitlogo copy gitlogominus -to 11 5
12459-
image delete gitlogominus
12460-
12461-
image create photo gitlogoplus -width 4 -height 4
12462-
gitlogoplus put #008000 -to 1 0 3 4
12463-
gitlogoplus put #008000 -to 0 1 4 3
12464-
gitlogo copy gitlogoplus -to 1 9
12465-
gitlogo copy gitlogoplus -to 6 9
12466-
gitlogo copy gitlogoplus -to 11 9
12467-
image delete gitlogoplus
12468-
12469-
image create photo gitlogo32 -width 32 -height 32
12470-
gitlogo32 copy gitlogo -zoom 2 2
12471-
12472-
wm iconphoto . -default gitlogo gitlogo32
12450+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12451+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12452+
} else {
12453+
catch {
12454+
image create photo gitlogo -width 16 -height 16
12455+
12456+
image create photo gitlogominus -width 4 -height 2
12457+
gitlogominus put #C00000 -to 0 0 4 2
12458+
gitlogo copy gitlogominus -to 1 5
12459+
gitlogo copy gitlogominus -to 6 5
12460+
gitlogo copy gitlogominus -to 11 5
12461+
image delete gitlogominus
12462+
12463+
image create photo gitlogoplus -width 4 -height 4
12464+
gitlogoplus put #008000 -to 1 0 3 4
12465+
gitlogoplus put #008000 -to 0 1 4 3
12466+
gitlogo copy gitlogoplus -to 1 9
12467+
gitlogo copy gitlogoplus -to 6 9
12468+
gitlogo copy gitlogoplus -to 11 9
12469+
image delete gitlogoplus
12470+
12471+
image create photo gitlogo32 -width 32 -height 32
12472+
gitlogo32 copy gitlogo -zoom 2 2
12473+
12474+
wm iconphoto . -default gitlogo gitlogo32
12475+
}
1247312476
}
1247412477
# wait for the window to become visible
1247512478
tkwait visibility .

0 commit comments

Comments
 (0)