git-gui: Be more Macintosh like.
It is tradition for applications to store their about and preferences menu options within the application menu. This is the first menu in the menu bar, just after the apple menu. Apparently the way to access this menu from Tk on Mac OS X systems is to create a special menu whose name ends in ".apple" and place it into the menu bar. So now if we are on Mac OS X we move our about menu and our options menu into the application menu, like other Mac OS X applications. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Nov 21, 2006 at 02:33 UTC
0c8d7839c9dafcfd33dae2bd35b9bf4a98ffa07a
1 file changed
+29
-11
git-gui
+29
-11
@@ -2659,7 +2659,6 @@ if {!$single_commit} {
2659
.mbar add cascade -label Pull -menu .mbar.pull
2660
.mbar add cascade -label Push -menu .mbar.push
2661
}
2662
-.mbar add cascade -label Help -menu .mbar.help
2662
. configure -menu .mbar
2663
2664
# -- Repository Menu
@@ -2731,10 +2730,6 @@ menu .mbar.edit
2730
-command {catch {[focus] tag add sel 0.0 end}} \
2731
-accelerator $M1T-A \
2732
-font font_ui
2734
-.mbar.edit add separator
2735
-.mbar.edit add command -label {Options...} \
2736
- -command do_options \
2737
- -font font_ui
2733
2734
# -- Commit Menu
2735
#
@@ -2808,13 +2803,36 @@ if {!$single_commit} {
2803
menu .mbar.push
2804
}
2805
2811
-# -- Help Menm
2812
-#
2813
-menu .mbar.help
2806
+if {[is_MacOSX]} {
2807
+ # -- Apple Menu (Mac OS X only)
2808
+ #
2809
+ .mbar add cascade -label Apple -menu .mbar.apple
2810
+ menu .mbar.apple
2811
+
2812
+ .mbar.apple add command -label "About $appname" \
2813
+ -command do_about \
2814
+ -font font_ui
2815
+ .mbar.apple add command -label "$appname Options..." \
2816
+ -command do_options \
2817
+ -font font_ui
2818
+} else {
2819
+ # -- Edit Menu
2820
+ #
2821
+ .mbar.edit add separator
2822
+ .mbar.edit add command -label {Options...} \
2823
+ -command do_options \
2824
+ -font font_ui
2825
+
2826
+ # -- Help Menu
2827
+ #
2828
+ .mbar add cascade -label Help -menu .mbar.help
2829
+ menu .mbar.help
2830
+
2831
+ .mbar.help add command -label "About $appname" \
2832
+ -command do_about \
2833
+ -font font_ui
2834
+}
2835
2815
-.mbar.help add command -label "About $appname" \
2816
- -command do_about \
2817
- -font font_ui
2836
2837
# -- Main Window Layout
2838
#