forked from sonic-pi-net/sonic-pi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GUI - remove duplicate fullscreen menu entry on macOS
macOS automagically adds an "Enter Fullscreen" entry to the menu. We already provide one of these for all platforms, so disable the macOS specific one. This requires some ObjectiveC funkiness...
- Loading branch information
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//-- | ||
// This file is part of Sonic Pi: http://sonic-pi.net | ||
// Full project source: https://github.com/sonic-pi-net/sonic-pi | ||
// License: https://github.com/sonic-pi-net/sonic-pi/blob/main/LICENSE.md | ||
// | ||
// Copyright 2020 by Sam Aaron (http://sam.aaron.name). | ||
// All rights reserved. | ||
// | ||
// Permission is granted for use, copying, modification, and | ||
// distribution of modified versions of this work as long as this | ||
// notice is included. | ||
//++ | ||
|
||
#pragma once | ||
|
||
namespace SonicPi { | ||
|
||
void removeMacosSpecificMenuItems(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//-- | ||
// This file is part of Sonic Pi: http://sonic-pi.net | ||
// Full project source: https://github.com/sonic-pi-net/sonic-pi | ||
// License: https://github.com/sonic-pi-net/sonic-pi/blob/main/LICENSE.md | ||
// | ||
// Copyright 2020 by Sam Aaron (http://sam.aaron.name). | ||
// All rights reserved. | ||
// | ||
// Permission is granted for use, copying, modification, and | ||
// distribution of modified versions of this work as long as this | ||
// notice is included. | ||
//++ | ||
|
||
#include "macos.h" | ||
#import <AppKit/NSWindow.h> | ||
|
||
namespace SonicPi { | ||
|
||
void removeMacosSpecificMenuItems() | ||
{ | ||
|
||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER | ||
// Remove (don't allow) the "Show Tab Bar" menu item from the "View" menu, | ||
// if supported | ||
|
||
if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)]) | ||
NSWindow.allowsAutomaticWindowTabbing = NO; | ||
#endif | ||
|
||
// Remove (don't have) the "Enter Full Screen" menu item from the "View" | ||
// menu | ||
|
||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"]; | ||
} | ||
|
||
} |