git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eygene Ryabinkin <rea-git@codelabs.ru>
To: paulus@samba.org
Cc: git@vger.kernel.org
Subject: [PATCH 2/2] Improve look-and-feel of the gitk tool.
Date: Tue, 27 Mar 2007 14:36:59 +0400	[thread overview]
Message-ID: <20070327103659.GY14837@codelabs.ru> (raw)

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.

Unified the look of the "About gitk" and "Key bindings" dialogs.

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
---
 gitk |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/gitk b/gitk
index f54ff27..0173660 100755
--- a/gitk
+++ b/gitk
@@ -938,12 +938,15 @@ Gitk - a commit viewer for git
 Copyright ╘ 2005-2006 Paul Mackerras
 
 Use and redistribute under the terms of the GNU General Public License} \
-	    -justify center -aspect 400
-    pack $w.m -side top -fill x -padx 20 -pady 20
+	    -justify center -aspect 400 -border 2 -bg white -relief groove
+    pack $w.m -side top -fill x -padx 2 -pady 2
     $w.m configure -font $uifont
-    button $w.ok -text Close -command "destroy $w"
+    button $w.ok -text Close -command "destroy $w" -default active
     pack $w.ok -side bottom
     $w.ok configure -font $uifont
+    bind $w <Visibility> "focus $w.ok"
+    bind $w <Key-Escape> "destroy $w"
+    bind $w <Key-Return> "destroy $w"
 }
 
 proc keys {} {
@@ -994,12 +997,15 @@ f		Scroll diff view to next file
 <Ctrl-minus>	Decrease font size
 <F5>		Update
 } \
-	    -justify left -bg white -border 2 -relief sunken
-    pack $w.m -side top -fill both
+	    -justify left -bg white -border 2 -relief groove
+    pack $w.m -side top -fill both -padx 2 -pady 2
     $w.m configure -font $uifont
-    button $w.ok -text Close -command "destroy $w"
+    button $w.ok -text Close -command "destroy $w" -default active
     pack $w.ok -side bottom
     $w.ok configure -font $uifont
+    bind $w <Visibility> "focus $w.ok"
+    bind $w <Key-Escape> "destroy $w"
+    bind $w <Key-Return> "destroy $w"
 }
 
 # Procedures for manipulating the file list window at the
@@ -5892,14 +5898,15 @@ proc doprefs {} {
     grid x $top.hunksepbut $top.hunksep -sticky w
 
     frame $top.buts
-    button $top.buts.ok -text "OK" -command prefsok
+    button $top.buts.ok -text "OK" -command prefsok -default active
     $top.buts.ok configure -font $uifont
-    button $top.buts.can -text "Cancel" -command prefscan
+    button $top.buts.can -text "Cancel" -command prefscan -default normal
     $top.buts.can configure -font $uifont
     grid $top.buts.ok $top.buts.can
     grid columnconfigure $top.buts 0 -weight 1 -uniform a
     grid columnconfigure $top.buts 1 -weight 1 -uniform a
     grid $top.buts - - -pady 10 -sticky ew
+    bind $top <Visibility> "focus $top.buts.ok"
 }
 
 proc choosecolor {v vi w x cmd} {
-- 
1.5.0.3-dirty

                 reply	other threads:[~2007-03-27 10:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070327103659.GY14837@codelabs.ru \
    --to=rea-git@codelabs.ru \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).