summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorLibravatar Marc Branchaud <marcnarc@xiplink.com>2015-04-07 11:51:51 -0400
committerLibravatar Paul Mackerras <paulus@samba.org>2015-05-17 11:38:47 +1000
commit9922c5a3340e77c7a3b199f25a49af5fdd7a5ef1 (patch)
tree507568a345c602ae6de401cd9c5d7e96c2626261 /gitk
parentgitk: Add mouse right-click options to copy path and branch name (diff)
downloadtgif-9922c5a3340e77c7a3b199f25a49af5fdd7a5ef1.tar.xz
gitk: Show the current view's name in the window title
If the current view is the "Command line" view, show the command line arguments instead of the view name. Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk17
1 files changed, 16 insertions, 1 deletions
diff --git a/gitk b/gitk
index dc1af41bb7..8c44e834eb 100755
--- a/gitk
+++ b/gitk
@@ -4036,6 +4036,19 @@ proc shellsplit {str} {
return $l
}
+proc set_window_title {} {
+ global appname curview viewname vrevs
+ set rev [mc "All files"]
+ if {$curview ne 0} {
+ if {$viewname($curview) eq [mc "Command line"]} {
+ set rev [string map {"--gitk-symmetric-diff-marker" "--merge"} $vrevs($curview)]
+ } else {
+ set rev $viewname($curview)
+ }
+ }
+ wm title . "[reponame]: $rev - $appname"
+}
+
# Code to implement multiple views
proc newview {ishighlight} {
@@ -4512,6 +4525,7 @@ proc showview {n} {
} elseif {$numcommits == 0} {
show_status [mc "No commits selected"]
}
+ set_window_title
}
# Stuff relating to the highlighting facility
@@ -6652,6 +6666,7 @@ proc show_status {msg} {
global canv fgcolor
clear_display
+ set_window_title
$canv create text 3 3 -anchor nw -text $msg -font mainfont \
-tags text -fill $fgcolor
}
@@ -12403,7 +12418,7 @@ catch {
}
# wait for the window to become visible
tkwait visibility .
-wm title . "[reponame] - $appname"
+set_window_title
update
readrefs