aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Schuberth <sschuberth@gmail.com>2012-07-22 23:19:24 +0200
committerJohannes Schindelin <johannes.schindelin@gmx.de>2025-01-11 18:17:42 +0100
commitbaaa9d6d8688ac1787e4be6087173c9e4341b162 (patch)
treec030d1bec5d75d84df99d6b5de26f807828defa1
parent5eb02dd8f08fc3b7ff22320c3311cd1da6a5ab4d (diff)
downloadgit-baaa9d6d8688ac1787e4be6087173c9e4341b162.tar.xz
gitk: Use an external icon file on Windows
Git for Windows now ships with the new Git icon from git-scm.com. Use that icon file if it exists instead of the old procedurally drawn one. This patch was sent upstream but so far no decision on its inclusion was made, so commit it to our fork. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rwxr-xr-xgitk41
1 files changed, 22 insertions, 19 deletions
diff --git a/gitk b/gitk
index ae694bfdc6..96b87df5d0 100755
--- a/gitk
+++ b/gitk
@@ -12471,7 +12471,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
set gitk_libdir [file join $gitk_prefix share gitk lib]
set gitk_msgsdir [file join $gitk_libdir msgs]
- unset gitk_prefix
}
## Internationalization (i18n) through msgcat and gettext. See
@@ -12837,28 +12836,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
set worktree [gitworktree]
setcoords
makewindow
-catch {
- image create photo gitlogo -width 16 -height 16
+if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
+ wm iconbitmap . -default $gitk_prefix/etc/git.ico
+} else {
+ 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 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
+ 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
- image create photo gitlogo32 -width 32 -height 32
- gitlogo32 copy gitlogo -zoom 2 2
+ image create photo gitlogo32 -width 32 -height 32
+ gitlogo32 copy gitlogo -zoom 2 2
- wm iconphoto . -default gitlogo gitlogo32
+ wm iconphoto . -default gitlogo gitlogo32
+ }
}
# wait for the window to become visible
if {![winfo viewable .]} {tkwait visibility .}