@matheusbsbs / matheus-bagliano / commits / a91be3fcbe
Fork 0

git-gui: Fixes for Mac OS X TkAqua

- detect more Tk.framework variants - fix apple menu setup, use native preferences menu item - don't set menu font Signed-off-by: Daniel A. Steffen <das@users.sourceforge.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Daniel A. Steffen committed Aug 16, 2008 at 03:20 UTC a91be3fcbe92c24e809b1ec85881a6da40a9a340
2 files changed +22 -19
Makefile
+5 -2
@@ -105,8 +105,11 @@ endif
105
106 ifeq ($(uname_S),Darwin)
107 TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
108 - ifeq ($(shell expr "$(uname_R)" : '9\.'),2)
109 - TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
108 + ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n)
109 + TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish.app
110 + ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n)
111 + TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
112 + endif
113 endif
114 TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app)
115 endif
git-gui.sh
+17 -17
@@ -663,10 +663,13 @@ font create font_diffbold
663 font create font_diffitalic
664
665 foreach class {Button Checkbutton Entry Label
666 - Labelframe Listbox Menu Message
666 + Labelframe Listbox Message
667 Radiobutton Spinbox Text} {
668 option add *$class.font font_ui
669 }
670 +if {![is_MacOSX]} {
671 + option add *Menu.font font_ui
672 +}
673 unset class
674
675 if {[is_Windows] || [is_MacOSX]} {
@@ -2301,6 +2304,12 @@ set ui_comm {}
2304 # -- Menu Bar
2305 #
2306 menu .mbar -tearoff 0
2307 +if {[is_MacOSX]} {
2308 + # -- Apple Menu (Mac OS X only)
2309 + #
2310 + .mbar add cascade -label Apple -menu .mbar.apple
2311 + menu .mbar.apple
2312 +}
2313 .mbar add cascade -label [mc Repository] -menu .mbar.repository
2314 .mbar add cascade -label [mc Edit] -menu .mbar.edit
2315 if {[is_enabled branch]} {
@@ -2316,7 +2325,6 @@ if {[is_enabled transport]} {
2325 if {[is_enabled multicommit] || [is_enabled singlecommit]} {
2326 .mbar add cascade -label [mc Tools] -menu .mbar.tools
2327 }
2319 -. configure -menu .mbar
2328
2329 # -- Repository Menu
2330 #
@@ -2569,19 +2577,7 @@ if {[is_enabled transport]} {
2577 }
2578
2579 if {[is_MacOSX]} {
2572 - # -- Apple Menu (Mac OS X only)
2573 - #
2574 - .mbar add cascade -label Apple -menu .mbar.apple
2575 - menu .mbar.apple
2576 -
2577 - .mbar.apple add command -label [mc "About %s" [appname]] \
2578 - -command do_about
2579 - .mbar.apple add separator
2580 - .mbar.apple add command \
2581 - -label [mc "Preferences..."] \
2582 - -command do_options \
2583 - -accelerator $M1T-,
2584 - bind . <$M1B-,> do_options
2580 + proc ::tk::mac::ShowPreferences {} {do_options}
2581 } else {
2582 # -- Edit Menu
2583 #
@@ -2609,11 +2605,15 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
2605 .mbar add cascade -label [mc Help] -menu .mbar.help
2606 menu .mbar.help
2607
2612 -if {![is_MacOSX]} {
2608 +if {[is_MacOSX]} {
2609 + .mbar.apple add command -label [mc "About %s" [appname]] \
2610 + -command do_about
2611 + .mbar.apple add separator
2612 +} else {
2613 .mbar.help add command -label [mc "About %s" [appname]] \
2614 -command do_about
2615 }
2616 -
2616 +. configure -menu .mbar
2617
2618 set doc_path [githtmldir]
2619 if {$doc_path ne {}} {