{"thread":{"id":"7426","subject":"[PATCH 3/4] Improve look-and-feel of the git-gui tool.","startedAt":"2007-03-27T10:31:02Z","lastAt":"2007-03-27T10:31:02Z","messageCount":1,"participants":["Eygene Ryabinkin"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"38131","messageId":"20070327103102.GQ14837@codelabs.ru","threadId":"7426","inReplyTo":null,"subject":"[PATCH 3/4] Improve look-and-feel of the git-gui tool.","fromName":"Eygene Ryabinkin","fromEmail":"rea-git@codelabs.ru","sentAt":"2007-03-27T10:31:02Z","receivedAt":"2007-03-27T10:31:02Z","isPatch":true,"sender":{"key":"rea-git@codelabs.ru","avatar":null},"body":"Made the default buttons on the dialog active and focused upon the\ndialog appearence.\n\nBound 'Escape' and 'Return' keys to the dialog dismissal where it\nwas appropriate: mainly for dialogs with only one button and no\neditable fields, but on console output dialogs as well.\n\nSigned-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>\n---\n git-gui/git-gui.sh |   19 +++++++++++++++----\n 1 files changed, 15 insertions(+), 4 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 1f3ee05..7c2ec6b 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -2710,10 +2710,12 @@ proc do_push_anywhere {} {\n \tframe $w.buttons\n \tbutton $w.buttons.create -text Push \\\n \t\t-font font_ui \\\n+\t\t-default active \\\n \t\t-command [list start_push_anywhere_action $w]\n \tpack $w.buttons.create -side right\n \tbutton $w.buttons.cancel -text {Cancel} \\\n \t\t-font font_ui \\\n+\t\t-default normal \\\n \t\t-command [list destroy $w]\n \tpack $w.buttons.cancel -side right -padx 5\n \tpack $w.buttons -side bottom -fill x -pady 10 -padx 10\n@@ -2805,7 +2807,7 @@ proc do_push_anywhere {} {\n \tset push_thin 0\n \tset push_tags 0\n \n-\tbind $w <Visibility> \"grab $w\"\n+\tbind $w <Visibility> \"grab $w; focus $w.buttons.create\"\n \tbind $w <Key-Escape> \"destroy $w\"\n \twm title $w \"[appname] ([reponame]): Push\"\n \ttkwait window $w\n@@ -4137,6 +4139,7 @@ proc console_done {args} {\n \t\tif {[winfo exists $w]} {\n \t\t\t$w.m.s conf -background green -text {Success}\n \t\t\t$w.ok conf -state normal\n+\t\t\tfocus $w.ok\n \t\t}\n \t} else {\n \t\tif {![winfo exists $w]} {\n@@ -4144,6 +4147,7 @@ proc console_done {args} {\n \t\t}\n \t\t$w.m.s conf -background red -text {Error: Command Failed}\n \t\t$w.ok conf -state normal\n+\t\tfocus $w.ok\n \t}\n \n \tarray unset console_cr $w\n@@ -4211,9 +4215,11 @@ proc do_stats {} {\n \tframe $w.buttons -border 1\n \tbutton $w.buttons.close -text Close \\\n \t\t-font font_ui \\\n+\t\t-default active \\\n \t\t-command [list destroy $w]\n \tbutton $w.buttons.gc -text {Compress Database} \\\n \t\t-font font_ui \\\n+\t\t-default normal \\\n \t\t-command \"destroy $w;do_gc\"\n \tpack $w.buttons.close -side right\n \tpack $w.buttons.gc -side left\n@@ -4242,7 +4248,7 @@ proc do_stats {} {\n \t}\n \tpack $w.stat -pady 10 -padx 10\n \n-\tbind $w <Visibility> \"grab $w; focus $w\"\n+\tbind $w <Visibility> \"grab $w; focus $w.buttons.close\"\n \tbind $w <Key-Escape> [list destroy $w]\n \tbind $w <Key-Return> [list destroy $w]\n \twm title $w \"[appname] ([reponame]): Database Statistics\"\n@@ -4539,6 +4545,7 @@ proc do_about {} {\n \tframe $w.buttons\n \tbutton $w.buttons.close -text {Close} \\\n \t\t-font font_ui \\\n+\t\t-default active \\\n \t\t-command [list destroy $w]\n \tpack $w.buttons.close -side right\n \tpack $w.buttons -side bottom -fill x -pady 10 -padx 10\n@@ -4584,8 +4591,9 @@ $copyright\" \\\n \t\tclipboard append -format STRING -type STRING -- \\[$w.vers cget -text\\]\n \t\"\n \n-\tbind $w <Visibility> \"grab $w; focus $w\"\n+\tbind $w <Visibility> \"grab $w; focus $w.buttons.close\"\n \tbind $w <Key-Escape> \"destroy $w\"\n+\tbind $w <Key-Return> \"destroy $w\"\n \tbind_button3 $w.vers \"tk_popup $w.ctxm %X %Y; grab $w; focus $w\"\n \twm title $w \"About [appname]\"\n \ttkwait window $w\n@@ -4622,14 +4630,17 @@ proc do_options {} {\n \tframe $w.buttons\n \tbutton $w.buttons.restore -text {Restore Defaults} \\\n \t\t-font font_ui \\\n+\t\t-default normal \\\n \t\t-command do_restore_defaults\n \tpack $w.buttons.restore -side left\n \tbutton $w.buttons.save -text Save \\\n \t\t-font font_ui \\\n+\t\t-default active \\\n \t\t-command [list do_save_config $w]\n \tpack $w.buttons.save -side right\n \tbutton $w.buttons.cancel -text {Cancel} \\\n \t\t-font font_ui \\\n+\t\t-default normal \\\n \t\t-command [list destroy $w]\n \tpack $w.buttons.cancel -side right -padx 5\n \tpack $w.buttons -side bottom -fill x -pady 10 -padx 10\n@@ -4733,7 +4744,7 @@ proc do_options {} {\n \t\tpack $w.global.$name -side top -anchor w -fill x\n \t}\n \n-\tbind $w <Visibility> \"grab $w; focus $w\"\n+\tbind $w <Visibility> \"grab $w; focus $w.buttons.save\"\n \tbind $w <Key-Escape> \"destroy $w\"\n \twm title $w \"[appname] ([reponame]): Options\"\n \ttkwait window $w\n-- \n1.5.0.3-dirty\n"}]}