summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorEygene Ryabinkin <rea-git@codelabs.ru>2007-03-27 10:31:02 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-04-04 15:37:56 (GMT)
commitdf0cd69558b826a0f43420ecc808557656961f62 (patch)
tree03f95a148dfe1d48ad74505d057fd896c6ba2fa3 /git-gui.sh
parent3cf0bad830c93176acc6e6436da42e1936bb2282 (diff)
downloadgit-df0cd69558b826a0f43420ecc808557656961f62.zip
git-df0cd69558b826a0f43420ecc808557656961f62.tar.gz
git-df0cd69558b826a0f43420ecc808557656961f62.tar.bz2
Improve look-and-feel of the git-gui tool.
Made the default buttons on the dialog active and focused upon the dialog appearence. Bound 'Escape' and 'Return' keys to the dialog dismissal where it was appropriate: mainly for dialogs with only one button and no editable fields, but on console output dialogs as well. Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 8157184..6e55bd4 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2705,10 +2705,12 @@ proc do_push_anywhere {} {
frame $w.buttons
button $w.buttons.create -text Push \
-font font_ui \
+ -default active \
-command [list start_push_anywhere_action $w]
pack $w.buttons.create -side right
button $w.buttons.cancel -text {Cancel} \
-font font_ui \
+ -default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -2799,7 +2801,7 @@ proc do_push_anywhere {} {
set push_thin 0
set push_tags 0
- bind $w <Visibility> "grab $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.create"
bind $w <Key-Escape> "destroy $w"
wm title $w "[appname] ([reponame]): Push"
tkwait window $w
@@ -4131,6 +4133,7 @@ proc console_done {args} {
if {[winfo exists $w]} {
$w.m.s conf -background green -text {Success}
$w.ok conf -state normal
+ focus $w.ok
}
} else {
if {![winfo exists $w]} {
@@ -4138,6 +4141,7 @@ proc console_done {args} {
}
$w.m.s conf -background red -text {Error: Command Failed}
$w.ok conf -state normal
+ focus $w.ok
}
array unset console_cr $w
@@ -4205,9 +4209,11 @@ proc do_stats {} {
frame $w.buttons -border 1
button $w.buttons.close -text Close \
-font font_ui \
+ -default active \
-command [list destroy $w]
button $w.buttons.gc -text {Compress Database} \
-font font_ui \
+ -default normal \
-command "destroy $w;do_gc"
pack $w.buttons.close -side right
pack $w.buttons.gc -side left
@@ -4236,7 +4242,7 @@ proc do_stats {} {
}
pack $w.stat -pady 10 -padx 10
- bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.close"
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [list destroy $w]
wm title $w "[appname] ([reponame]): Database Statistics"
@@ -4533,6 +4539,7 @@ proc do_about {} {
frame $w.buttons
button $w.buttons.close -text {Close} \
-font font_ui \
+ -default active \
-command [list destroy $w]
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -4578,8 +4585,9 @@ $copyright" \
clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
"
- bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.close"
bind $w <Key-Escape> "destroy $w"
+ bind $w <Key-Return> "destroy $w"
bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w"
wm title $w "About [appname]"
tkwait window $w
@@ -4616,14 +4624,17 @@ proc do_options {} {
frame $w.buttons
button $w.buttons.restore -text {Restore Defaults} \
-font font_ui \
+ -default normal \
-command do_restore_defaults
pack $w.buttons.restore -side left
button $w.buttons.save -text Save \
-font font_ui \
+ -default active \
-command [list do_save_config $w]
pack $w.buttons.save -side right
button $w.buttons.cancel -text {Cancel} \
-font font_ui \
+ -default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -4726,7 +4737,7 @@ proc do_options {} {
pack $w.global.$name -side top -anchor w -fill x
}
- bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Visibility> "grab $w; focus $w.buttons.save"
bind $w <Key-Escape> "destroy $w"
wm title $w "[appname] ([reponame]): Options"
tkwait window $w