threads / patch / 18397

patch, 2 partsgitk window icons

Subject: [PATCH 0/2] gitk window icons

## tl;dr

4 messages between Mar 19, 2009 and Mar 23, 2009. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Stephen Boyd· Mar 19, 2009, 08:54 UTC · lore

These two patches set the git logo, three red minus signs and three green plus signs below on a white background, as the window icon for gitk.

I found this first patch by Giuseppe posted to the mailing list a couple months ago. I've simply added a 32x32 icon in the second patch so that window managers can provide a slightly better looking icon when they need a bigger icon (ALT-TAB for example).

This logo is different than the logo used by git-gui. Do we want to use that logo instead?

Giuseppe Bilotta (1):
  gitk: try to provide a window icon
Stephen Boyd (1):
  gitk: provide a 32x32 window icon based on the git logo
 gitk |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
Stephen Boyd· Mar 19, 2009, 08:54 UTC · re: Stephen Boyd · lore

[PATCH 1/2] gitk: try to provide a window icon

From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

Try to set up a 16x16 Tk photo image (based on the git logo) and use it as window icon. Wrap the code 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>
---
 gitk |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
Show changes to gitk +20 −0
diff --git a/gitk b/gitk
index 1773ae6..cfbb699 100755
--- a/gitk
+++ b/gitk
@@ -10883,6 +10883,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]]"
-- 
1.6.2
Stephen Boyd· Mar 19, 2009, 08:54 UTC · re: Stephen Boyd · lore

[PATCH 2/2] gitk: provide a 32x32 window icon based on the git logo

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 gitk |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
Show changes to gitk +4 −1
diff --git a/gitk b/gitk
index cfbb699..5a09eca 100755
--- a/gitk
+++ b/gitk
@@ -10901,7 +10901,10 @@ catch {
 	gitlogo copy gitlogoplus  -to 11 9
 	image delete gitlogoplus
 
-	wm iconphoto . -default gitlogo
+	image create photo gitlogo32    -width 32 -height 32
+	gitlogo32 copy gitlogo -zoom 2 2
+
+	wm iconphoto . -default gitlogo gitlogo32
 }
 # wait for the window to become visible
 tkwait visibility .
-- 
1.6.2
Paul Mackerras· Mar 23, 2009, 10:59 UTC · re: Stephen Boyd · lore

Re: [PATCH 0/2] gitk window icons

Stephen Boyd writes:
> These two patches set the git logo, three red minus signs and three green plus
> signs below on a white background, as the window icon for gitk.

Thanks, applied. (I adjusted the indentation in both and wrote a brief commit message for the second.)

Paul.

← back to recent threads