]> rtime.felk.cvut.cz Git - sojka/git-gui.git/commitdiff
git-gui: Fixes for Mac OS X TkAqua
authorDaniel A. Steffen <das@users.sourceforge.net>
Sat, 16 Aug 2008 01:20:09 +0000 (03:20 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 1 May 2009 22:04:52 +0000 (15:04 -0700)
- 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>
Makefile
git-gui.sh

index 3ad8a21b30128ce21b6b6c28094d9af5e5866faf..b3580e9e48b6ac5d1a7fbd010f032445702f140f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -105,8 +105,11 @@ endif
 
 ifeq ($(uname_S),Darwin)
        TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
-       ifeq ($(shell expr "$(uname_R)" : '9\.'),2)
-               TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
+       ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n)
+               TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish.app
+               ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n)
+                       TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
+               endif
        endif
        TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app)
 endif
index c8f850d1ef5881a537ed67ad66887bf852a153f9..14b92ba786554f4e714c89191e5584a825964ab2 100755 (executable)
@@ -663,10 +663,13 @@ font create font_diffbold
 font create font_diffitalic
 
 foreach class {Button Checkbutton Entry Label
-               Labelframe Listbox Menu Message
+               Labelframe Listbox Message
                Radiobutton Spinbox Text} {
        option add *$class.font font_ui
 }
+if {![is_MacOSX]} {
+       option add *Menu.font font_ui
+}
 unset class
 
 if {[is_Windows] || [is_MacOSX]} {
@@ -2301,6 +2304,12 @@ set ui_comm {}
 # -- Menu Bar
 #
 menu .mbar -tearoff 0
+if {[is_MacOSX]} {
+       # -- Apple Menu (Mac OS X only)
+       #
+       .mbar add cascade -label Apple -menu .mbar.apple
+       menu .mbar.apple
+}
 .mbar add cascade -label [mc Repository] -menu .mbar.repository
 .mbar add cascade -label [mc Edit] -menu .mbar.edit
 if {[is_enabled branch]} {
@@ -2316,7 +2325,6 @@ if {[is_enabled transport]} {
 if {[is_enabled multicommit] || [is_enabled singlecommit]} {
        .mbar add cascade -label [mc Tools] -menu .mbar.tools
 }
-. configure -menu .mbar
 
 # -- Repository Menu
 #
@@ -2569,19 +2577,7 @@ if {[is_enabled transport]} {
 }
 
 if {[is_MacOSX]} {
-       # -- Apple Menu (Mac OS X only)
-       #
-       .mbar add cascade -label Apple -menu .mbar.apple
-       menu .mbar.apple
-
-       .mbar.apple add command -label [mc "About %s" [appname]] \
-               -command do_about
-       .mbar.apple add separator
-       .mbar.apple add command \
-               -label [mc "Preferences..."] \
-               -command do_options \
-               -accelerator $M1T-,
-       bind . <$M1B-,> do_options
+       proc ::tk::mac::ShowPreferences {} {do_options}
 } else {
        # -- Edit Menu
        #
@@ -2609,11 +2605,15 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 .mbar add cascade -label [mc Help] -menu .mbar.help
 menu .mbar.help
 
-if {![is_MacOSX]} {
+if {[is_MacOSX]} {
+       .mbar.apple add command -label [mc "About %s" [appname]] \
+               -command do_about
+       .mbar.apple add separator
+} else {
        .mbar.help add command -label [mc "About %s" [appname]] \
                -command do_about
 }
-
+. configure -menu .mbar
 
 set doc_path [githtmldir]
 if {$doc_path ne {}} {