summaryrefslogtreecommitdiff
path: root/git-gui/git-gui.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-06-11 07:51:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-11 07:51:39 (GMT)
commitc288a2f1316b642ff073d4213cf691297610503c (patch)
treed01719f0d535306f1f6812da18494d423822a950 /git-gui/git-gui.sh
parent23c9ccb215709422f9dff2ace6cf460ceb1e61dc (diff)
parentd80ded01de0189fe7179913d3ecdeecadf2052a0 (diff)
downloadgit-c288a2f1316b642ff073d4213cf691297610503c.zip
git-c288a2f1316b642ff073d4213cf691297610503c.tar.gz
git-c288a2f1316b642ff073d4213cf691297610503c.tar.bz2
Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui: (46 commits) git-gui: Changed blame header bar background to match main window git-gui: Favor the original annotations over the recent ones git-gui: Improve our labeling of blame annotation types git-gui: Use three colors for the blame viewer background git-gui: Jump to original line in blame viewer git-gui: Display both commits in our tooltips git-gui: Run blame twice on the same file and display both outputs git-gui: Display the "Loading annotation..." message in italic git-gui: Rename fields in blame viewer to better descriptions git-gui: Label the uncommitted blame history entry git-gui: Switch internal blame structure to Tcl lists git-gui: Cleanup redundant column management in blame viewer git-gui: Better document our blame variables git-gui: Remove unused commit_list from blame viewer git-gui: Automatically expand the line number column as needed git-gui: Make the line number column slightly wider in blame git-gui: Use lighter colors in blame view git-gui: Remove unnecessary space between columns in blame viewer git-gui: Remove the loaded column from the blame viewer git-gui: Clip the commit summaries in the blame history menu ...
Diffstat (limited to 'git-gui/git-gui.sh')
-rwxr-xr-xgit-gui/git-gui.sh49
1 files changed, 34 insertions, 15 deletions
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index dba5851..dfb4b95 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -22,6 +22,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
######################################################################
##
+## Tcl/Tk sanity check
+
+if {[catch {package require Tcl 8.4} err]
+ || [catch {package require Tk 8.4} err]
+} {
+ catch {wm withdraw .}
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title "git-gui: fatal error" \
+ -message $err
+ exit 1
+}
+
+######################################################################
+##
## configure our library
set oguilib {@@GITGUI_LIBDIR@@}
@@ -1008,6 +1024,7 @@ proc incr_font_size {font {amt 1}} {
incr sz $amt
font configure $font -size $sz
font configure ${font}bold -size $sz
+ font configure ${font}italic -size $sz
}
######################################################################
@@ -1200,12 +1217,14 @@ catch {
destroy .dummy
}
+font create font_uiitalic
font create font_uibold
font create font_diffbold
+font create font_diffitalic
foreach class {Button Checkbutton Entry Label
Labelframe Listbox Menu Message
- Radiobutton Text} {
+ Radiobutton Spinbox Text} {
option add *$class.font font_ui
}
unset class
@@ -1233,8 +1252,10 @@ proc apply_config {} {
}
foreach {cn cv} [font configure $font] {
font configure ${font}bold $cn $cv
+ font configure ${font}italic $cn $cv
}
font configure ${font}bold -weight bold
+ font configure ${font}italic -slant italic
}
}
@@ -1600,7 +1621,7 @@ unset browser doc_path doc_url
# -- Standard bindings
#
-bind . <Destroy> do_quit
+bind . <Destroy> {if {{%W} eq {.}} do_quit}
bind all <$M1B-Key-q> do_quit
bind all <$M1B-Key-Q> do_quit
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
@@ -1715,7 +1736,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
#
frame .vpane.files.index -height 100 -width 200
label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
- -background green
+ -background lightgreen
text $ui_index -background white -borderwidth 0 \
-width 20 -height 10 \
-wrap none \
@@ -1735,7 +1756,7 @@ pack $ui_index -side left -fill both -expand 1
#
frame .vpane.files.workdir -height 100 -width 200
label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
- -background red
+ -background lightsalmon
text $ui_workdir -background white -borderwidth 0 \
-width 20 -height 10 \
-wrap none \
@@ -1752,10 +1773,8 @@ pack $ui_workdir -side left -fill both -expand 1
.vpane.files add .vpane.files.workdir -sticky nsew
foreach i [list $ui_index $ui_workdir] {
- $i tag conf in_diff -font font_uibold
- $i tag conf in_sel \
- -background [$i cget -foreground] \
- -foreground [$i cget -background]
+ $i tag conf in_diff -background lightgray
+ $i tag conf in_sel -background lightgray
}
unset i
@@ -1913,18 +1932,18 @@ proc trace_current_diff_path {varname args} {
}
trace add variable current_diff_path write trace_current_diff_path
-frame .vpane.lower.diff.header -background orange
+frame .vpane.lower.diff.header -background gold
label .vpane.lower.diff.header.status \
- -background orange \
+ -background gold \
-width $max_status_desc \
-anchor w \
-justify left
label .vpane.lower.diff.header.file \
- -background orange \
+ -background gold \
-anchor w \
-justify left
label .vpane.lower.diff.header.path \
- -background orange \
+ -background gold \
-anchor w \
-justify left
pack .vpane.lower.diff.header.status -side left
@@ -2038,17 +2057,17 @@ lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command \
-label {Show Less Context} \
- -command {if {$repo_config(gui.diffcontext) >= 2} {
+ -command {if {$repo_config(gui.diffcontext) >= 1} {
incr repo_config(gui.diffcontext) -1
reshow_diff
}}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
-label {Show More Context} \
- -command {
+ -command {if {$repo_config(gui.diffcontext) < 99} {
incr repo_config(gui.diffcontext)
reshow_diff
- }
+ }}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command -label {Options...} \