# [PATCH 0/2] gitk window icons

4 messages from 2009-03-19 to 2009-03-23. Participants: Stephen Boyd, Paul Mackerras.
Thread: https://gitlist.dev/t/18397

## Stephen Boyd, 2009-03-19 08:54

Subject: [PATCH 0/2] gitk window icons
Message-ID: <cover.1237451887.git.bebarino@gmail.com>
URL: https://gitlist.dev/e/cover.1237451887.git.bebarino%40gmail.com

```
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, 2009-03-19 08:54

Subject: [PATCH 1/2] gitk: try to provide a window icon
Message-ID: <61242ff6c582f3b82b7ddf4db75bdad45f0a457e.1237451887.git.bebarino@gmail.com>
URL: https://gitlist.dev/e/61242ff6c582f3b82b7ddf4db75bdad45f0a457e.1237451887.git.bebarino%40gmail.com
In-Reply-To: <cover.1237451887.git.bebarino@gmail.com>

```
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(-)

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, 2009-03-19 08:54

Subject: [PATCH 2/2] gitk: provide a 32x32 window icon based on the git logo
Message-ID: <9a1d5cc34e91679beec3e82c52512f33b2ba9d7e.1237451887.git.bebarino@gmail.com>
URL: https://gitlist.dev/e/9a1d5cc34e91679beec3e82c52512f33b2ba9d7e.1237451887.git.bebarino%40gmail.com
In-Reply-To: <61242ff6c582f3b82b7ddf4db75bdad45f0a457e.1237451887.git.bebarino@gmail.com>

```
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 gitk |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

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, 2009-03-23 10:59

Subject: Re: [PATCH 0/2] gitk window icons
Message-ID: <18887.27561.995982.97262@cargo.ozlabs.ibm.com>
URL: https://gitlist.dev/e/18887.27561.995982.97262%40cargo.ozlabs.ibm.com
In-Reply-To: <cover.1237451887.git.bebarino@gmail.com>

```
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.

```
