[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-cvs
Subject:    [LyX/master] #11756 cleanup the view menu on Mac
From:       Stephan Witt <switt () lyx ! org>
Date:       2020-08-30 13:20:19
Message-ID: 20200830132019.61FC6280808 () lyx ! lyx ! org
[Download RAW message or body]

commit 292799a4bd3fead1d631678a94a4eccc89193201
Author: Stephan Witt <switt@lyx.org>
Date:   Sun Aug 30 15:34:44 2020 +0200

    #11756 cleanup the view menu on Mac
    
    Using US english desktop language LyX's Mac OS adds some items to the view menu:
    1. Show/Hide Tab Bar and
    2. Enter Full Screen
    These items won't work properly and it's better to hide them.
---
 src/frontends/qt/GuiApplication.cpp |    1 +
 src/support/AppleSupport.h          |    1 +
 src/support/AppleSupport.m          |   12 ++++++++++++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp
index 64d2577..eb92be7 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -1034,6 +1034,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
 	///
 	setupApplescript();
 	appleCleanupEditMenu();
+	appleCleanupViewMenu();
 #endif
 
 #if defined(Q_WS_X11) || defined(QPA_XCB)
diff --git a/src/support/AppleSupport.h b/src/support/AppleSupport.h
index a6da335..ef055cb 100644
--- a/src/support/AppleSupport.h
+++ b/src/support/AppleSupport.h
@@ -16,6 +16,7 @@
 extern "C" {
 #endif
 	void appleCleanupEditMenu();
+	void appleCleanupViewMenu();
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/support/AppleSupport.m b/src/support/AppleSupport.m
index 4cac559..edbede4 100644
--- a/src/support/AppleSupport.m
+++ b/src/support/AppleSupport.m
@@ -19,5 +19,17 @@ void appleCleanupEditMenu() {
 
 	[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
 	[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledCharacterPaletteMenuItem"];
+}
+
+
+void appleCleanupViewMenu() {
+
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
+	// Remove the "Show Tab Bar" menu item from the "View" menu, if supported
+	if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)])
+		NSWindow.allowsAutomaticWindowTabbing = NO;
+#endif
 
+	// Remove the "Enter Full Screen" menu item from the "View" menu
+	[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
 }
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic