#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.
This commit is contained in:
Stephan Witt 2020-08-30 15:34:44 +02:00
parent a99695ce82
commit 292799a4bd
3 changed files with 15 additions and 1 deletions

View File

@ -1034,6 +1034,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
///
setupApplescript();
appleCleanupEditMenu();
appleCleanupViewMenu();
#endif
#if defined(Q_WS_X11) || defined(QPA_XCB)

View File

@ -16,6 +16,7 @@
extern "C" {
#endif
void appleCleanupEditMenu();
void appleCleanupViewMenu();
#ifdef __cplusplus
}
#endif

View File

@ -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"];
}