git-gui: Bind Cmd-, to Preferences on Mac OS X
A Mac OS X UI convention is to have Cmd-, be the accelerator key for the preferences window, which by convention is located in the apple menu under a separator below the about command. We also now call this "Preferences..." as that is the conventional term used in English. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Oct 7, 2007 at 22:39 UTC
13824e2df23c18eab28b2b9a8c112276a84dd419
2 files changed
+13
-7
git-gui.sh
+6
-2
@@ -2018,8 +2018,12 @@ if {[is_MacOSX]} {
2018
2019
.mbar.apple add command -label [mc "About %s" [appname]] \
2020
-command do_about
2021
- .mbar.apple add command -label [mc "Options..."] \
2022
- -command do_options
2021
+ .mbar.apple add separator
2022
+ .mbar.apple add command \
2023
+ -label [mc "Preferences..."] \
2024
+ -command do_options \
2025
+ -accelerator $M1T-,
2026
+ bind . <$M1B-,> do_options
2027
} else {
2028
# -- Edit Menu
2029
#
lib/option.tcl
+7
-5
@@ -78,10 +78,6 @@ proc do_options {} {
78
toplevel $w
79
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
80
81
- label $w.header -text [mc "Options"] \
82
- -font font_uibold
83
- pack $w.header -side top -fill x
84
-
81
frame $w.buttons
82
button $w.buttons.restore -text [mc "Restore Defaults"] \
83
-default normal \
@@ -199,7 +195,13 @@ proc do_options {} {
195
bind $w <Visibility> "grab $w; focus $w.buttons.save"
196
bind $w <Key-Escape> "destroy $w"
197
bind $w <Key-Return> [list do_save_config $w]
202
- wm title $w [append "[appname] ([reponame]): " [mc "Options"]]
198
+
199
+ if {[is_MacOSX]} {
200
+ set t [mc "Preferences"]
201
+ } else {
202
+ set t [mc "Options"]
203
+ }
204
+ wm title $w "[appname] ([reponame]): $t"
205
tkwait window $w
206
}
207