Skip to content

Commit 37871b7

Browse files
Oblomovpaulusmack
authored andcommitted
gitk: Provide a window icon if possible
Try to set up a 16x16 Tk photo image (based on the git logo) and use it as window icon. The code is wrapped in a catch because it may fail in earlier Tcl/Tk 8.4 releases that don't provide 'wm iconphoto'. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 681c329 commit 37871b7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

gitk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10884,6 +10884,26 @@ set lserial 0
1088410884
set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
1088510885
setcoords
1088610886
makewindow
10887+
catch {
10888+
image create photo gitlogo -width 16 -height 16
10889+
10890+
image create photo gitlogominus -width 4 -height 2
10891+
gitlogominus put #C00000 -to 0 0 4 2
10892+
gitlogo copy gitlogominus -to 1 5
10893+
gitlogo copy gitlogominus -to 6 5
10894+
gitlogo copy gitlogominus -to 11 5
10895+
image delete gitlogominus
10896+
10897+
image create photo gitlogoplus -width 4 -height 4
10898+
gitlogoplus put #008000 -to 1 0 3 4
10899+
gitlogoplus put #008000 -to 0 1 4 3
10900+
gitlogo copy gitlogoplus -to 1 9
10901+
gitlogo copy gitlogoplus -to 6 9
10902+
gitlogo copy gitlogoplus -to 11 9
10903+
image delete gitlogoplus
10904+
10905+
wm iconphoto . -default gitlogo
10906+
}
1088710907
# wait for the window to become visible
1088810908
tkwait visibility .
1088910909
wm title . "[file tail $argv0]: [file tail [pwd]]"

0 commit comments

Comments
 (0)