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>
This commit is contained in:
@ -2018,8 +2018,12 @@ if {[is_MacOSX]} {
|
|||||||
|
|
||||||
.mbar.apple add command -label [mc "About %s" [appname]] \
|
.mbar.apple add command -label [mc "About %s" [appname]] \
|
||||||
-command do_about
|
-command do_about
|
||||||
.mbar.apple add command -label [mc "Options..."] \
|
.mbar.apple add separator
|
||||||
-command do_options
|
.mbar.apple add command \
|
||||||
|
-label [mc "Preferences..."] \
|
||||||
|
-command do_options \
|
||||||
|
-accelerator $M1T-,
|
||||||
|
bind . <$M1B-,> do_options
|
||||||
} else {
|
} else {
|
||||||
# -- Edit Menu
|
# -- Edit Menu
|
||||||
#
|
#
|
||||||
|
@ -78,10 +78,6 @@ proc do_options {} {
|
|||||||
toplevel $w
|
toplevel $w
|
||||||
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
|
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
|
||||||
|
|
||||||
label $w.header -text [mc "Options"] \
|
|
||||||
-font font_uibold
|
|
||||||
pack $w.header -side top -fill x
|
|
||||||
|
|
||||||
frame $w.buttons
|
frame $w.buttons
|
||||||
button $w.buttons.restore -text [mc "Restore Defaults"] \
|
button $w.buttons.restore -text [mc "Restore Defaults"] \
|
||||||
-default normal \
|
-default normal \
|
||||||
@ -199,7 +195,13 @@ proc do_options {} {
|
|||||||
bind $w <Visibility> "grab $w; focus $w.buttons.save"
|
bind $w <Visibility> "grab $w; focus $w.buttons.save"
|
||||||
bind $w <Key-Escape> "destroy $w"
|
bind $w <Key-Escape> "destroy $w"
|
||||||
bind $w <Key-Return> [list do_save_config $w]
|
bind $w <Key-Return> [list do_save_config $w]
|
||||||
wm title $w [append "[appname] ([reponame]): " [mc "Options"]]
|
|
||||||
|
if {[is_MacOSX]} {
|
||||||
|
set t [mc "Preferences"]
|
||||||
|
} else {
|
||||||
|
set t [mc "Options"]
|
||||||
|
}
|
||||||
|
wm title $w "[appname] ([reponame]): $t"
|
||||||
tkwait window $w
|
tkwait window $w
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user