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>
Giuseppe Bilotta committed
Mar 19, 2009 at 01:54 UTC
37871b735aa427c440590966d4cacaf219a21292
1 file changed
+20
gitk
+20
@@ -10884,6 +10884,26 @@ set lserial 0
10884
set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
10885
setcoords
10886
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
+}
10907
# wait for the window to become visible
10908
tkwait visibility .
10909
wm title . "[file tail $argv0]: [file tail [pwd]]"