summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-03-19 08:54:17 (GMT)
committerPaul Mackerras <paulus@samba.org>2009-03-23 10:52:59 (GMT)
commit37871b735aa427c440590966d4cacaf219a21292 (patch)
treea67ee87ee5abfc00e1160715c51903be07ca425c
parent681c3290e379e61f9dd762039f140296434d1d9f (diff)
downloadgit-37871b735aa427c440590966d4cacaf219a21292.zip
git-37871b735aa427c440590966d4cacaf219a21292.tar.gz
git-37871b735aa427c440590966d4cacaf219a21292.tar.bz2
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>
-rwxr-xr-xgitk20
1 files changed, 20 insertions, 0 deletions
diff --git a/gitk b/gitk
index d7de27e..82bc2af 100755
--- a/gitk
+++ b/gitk
@@ -10884,6 +10884,26 @@ set lserial 0
set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
setcoords
makewindow
+catch {
+ image create photo gitlogo -width 16 -height 16
+
+ image create photo gitlogominus -width 4 -height 2
+ gitlogominus put #C00000 -to 0 0 4 2
+ gitlogo copy gitlogominus -to 1 5
+ gitlogo copy gitlogominus -to 6 5
+ gitlogo copy gitlogominus -to 11 5
+ image delete gitlogominus
+
+ image create photo gitlogoplus -width 4 -height 4
+ gitlogoplus put #008000 -to 1 0 3 4
+ gitlogoplus put #008000 -to 0 1 4 3
+ gitlogo copy gitlogoplus -to 1 9
+ gitlogo copy gitlogoplus -to 6 9
+ gitlogo copy gitlogoplus -to 11 9
+ image delete gitlogoplus
+
+ wm iconphoto . -default gitlogo
+}
# wait for the window to become visible
tkwait visibility .
wm title . "[file tail $argv0]: [file tail [pwd]]"