Skip to content

Commit 3a950e9

Browse files
Eygene Ryabinkinpaulusmack
authored andcommitted
[PATCH] Improve look-and-feel of the gitk 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. Unified the look of the "About gitk" and "Key bindings" dialogs. Signed-off-by: Eygene Ryabinkin <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent d59c4b6 commit 3a950e9

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

gitk

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -938,12 +938,15 @@ Gitk - a commit viewer for git
938938
Copyright © 2005-2006 Paul Mackerras
939939

940940
Use and redistribute under the terms of the GNU General Public License} \
941-
-justify center -aspect 400
942-
pack $w.m -side top -fill x -padx 20 -pady 20
941+
-justify center -aspect 400 -border 2 -bg white -relief groove
942+
pack $w.m -side top -fill x -padx 2 -pady 2
943943
$w.m configure -font $uifont
944-
button $w.ok -text Close -command "destroy $w"
944+
button $w.ok -text Close -command "destroy $w" -default active
945945
pack $w.ok -side bottom
946946
$w.ok configure -font $uifont
947+
bind $w <Visibility> "focus $w.ok"
948+
bind $w <Key-Escape> "destroy $w"
949+
bind $w <Key-Return> "destroy $w"
947950
}
948951

949952
proc keys {} {
@@ -994,12 +997,15 @@ f Scroll diff view to next file
994997
<Ctrl-minus> Decrease font size
995998
<F5> Update
996999
} \
997-
-justify left -bg white -border 2 -relief sunken
998-
pack $w.m -side top -fill both
1000+
-justify left -bg white -border 2 -relief groove
1001+
pack $w.m -side top -fill both -padx 2 -pady 2
9991002
$w.m configure -font $uifont
1000-
button $w.ok -text Close -command "destroy $w"
1003+
button $w.ok -text Close -command "destroy $w" -default active
10011004
pack $w.ok -side bottom
10021005
$w.ok configure -font $uifont
1006+
bind $w <Visibility> "focus $w.ok"
1007+
bind $w <Key-Escape> "destroy $w"
1008+
bind $w <Key-Return> "destroy $w"
10031009
}
10041010

10051011
# Procedures for manipulating the file list window at the
@@ -5892,14 +5898,15 @@ proc doprefs {} {
58925898
grid x $top.hunksepbut $top.hunksep -sticky w
58935899

58945900
frame $top.buts
5895-
button $top.buts.ok -text "OK" -command prefsok
5901+
button $top.buts.ok -text "OK" -command prefsok -default active
58965902
$top.buts.ok configure -font $uifont
5897-
button $top.buts.can -text "Cancel" -command prefscan
5903+
button $top.buts.can -text "Cancel" -command prefscan -default normal
58985904
$top.buts.can configure -font $uifont
58995905
grid $top.buts.ok $top.buts.can
59005906
grid columnconfigure $top.buts 0 -weight 1 -uniform a
59015907
grid columnconfigure $top.buts 1 -weight 1 -uniform a
59025908
grid $top.buts - - -pady 10 -sticky ew
5909+
bind $top <Visibility> "focus $top.buts.ok"
59035910
}
59045911

59055912
proc choosecolor {v vi w x cmd} {

0 commit comments

Comments
 (0)