Enter Full Screen menu item and separator are now hidden until the main window wakes and detects toggleFullScreen selector

CQTexperiment
Chris Moeller 2013-10-11 03:39:57 -07:00
parent 3f35b5e07f
commit 602aaa6938
5 changed files with 20 additions and 14 deletions

View File

@ -99,4 +99,7 @@ OSStatus handleHotKey(EventHandlerCallRef nextHandler,EventRef theEvent,void *us
- (void)nodeExpanded:(NSNotification*)notification; - (void)nodeExpanded:(NSNotification*)notification;
- (void)nodeCollapsed:(NSNotification*)notification; - (void)nodeCollapsed:(NSNotification*)notification;
- (void)windowDidEnterFullScreen:(NSNotification *)notification;
- (void)windowDidExitFullScreen:(NSNotification *)notification;
@end @end

View File

@ -275,9 +275,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
[playbackController seek:[NSNumber numberWithDouble:[[NSUserDefaults standardUserDefaults] floatForKey:@"lastTrackPosition"]]]; [playbackController seek:[NSNumber numberWithDouble:[[NSUserDefaults standardUserDefaults] floatForKey:@"lastTrackPosition"]]];
} }
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterFullscreen) name:NSWindowDidEnterFullScreenNotification object:mainWindow];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitFullscreen) name:NSWindowDidExitFullScreenNotification object:mainWindow];
// We need file tree view to restore its state here // We need file tree view to restore its state here
// so attempt to access file tree view controller's root view // so attempt to access file tree view controller's root view
// to force it to read nib and create file tree view for us // to force it to read nib and create file tree view for us
@ -584,7 +581,7 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
} }
} }
- (void)enterFullscreen - (void)windowDidEnterFullScreen:(NSNotification *)notification
{ {
NSLog(@"Entering fullscreen"); NSLog(@"Entering fullscreen");
if (nil == nowPlaying) if (nil == nowPlaying)
@ -611,7 +608,7 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
} }
} }
- (void)exitFullscreen - (void)windowDidExitFullScreen:(NSNotification *)notification
{ {
NSLog(@"Exiting fullscreen"); NSLog(@"Exiting fullscreen");
if (nowPlaying) if (nowPlaying)

View File

@ -82,7 +82,7 @@
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell> </tableHeaderCell>
<imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="9E1EC36B-776F-41F6-84BA-3BCF9937C65D" id="1801"> <imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AE428D9F-3521-44E5-A3BF-1E9BBDE889D6" id="1801">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
</imageCell> </imageCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
@ -552,6 +552,8 @@
</binding> </binding>
<outlet property="delegate" destination="226" id="481"/> <outlet property="delegate" destination="226" id="481"/>
<outlet property="initialFirstResponder" destination="207" id="720"/> <outlet property="initialFirstResponder" destination="207" id="720"/>
<outlet property="itemLionFullscreenToggle" destination="6FK-oo-X6Z" id="AFZ-tU-eoC"/>
<outlet property="itemLionSeparator" destination="LXf-6h-S7b" id="1Bl-jw-Bhi"/>
<outlet property="otherWindow" destination="2234" id="2304"/> <outlet property="otherWindow" destination="2234" id="2304"/>
</connections> </connections>
</window> </window>
@ -924,8 +926,8 @@
<action selector="decreaseFontSize:" target="226" id="1872"/> <action selector="decreaseFontSize:" target="226" id="1872"/>
</connections> </connections>
</menuItem> </menuItem>
<menuItem isSeparatorItem="YES" id="LXf-6h-S7b"/> <menuItem isSeparatorItem="YES" hidden="YES" id="LXf-6h-S7b"/>
<menuItem title="Enter Full Screen" keyEquivalent="f" id="6FK-oo-X6Z" userLabel="Menu Item - Enter Full Screen"> <menuItem title="Enter Full Screen" hidden="YES" keyEquivalent="f" id="6FK-oo-X6Z" userLabel="Menu Item - Enter Full Screen">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/> <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections> <connections>
<action selector="toggleFullScreen:" target="-1" id="UCw-gd-iiw"/> <action selector="toggleFullScreen:" target="-1" id="UCw-gd-iiw"/>
@ -1651,7 +1653,7 @@ Gw
<customObject id="2434" customClass="FeedbackController"/> <customObject id="2434" customClass="FeedbackController"/>
</objects> </objects>
<resources> <resources>
<image name="9E1EC36B-776F-41F6-84BA-3BCF9937C65D" width="17" height="17"> <image name="AE428D9F-3521-44E5-A3BF-1E9BBDE889D6" width="17" height="17">
<mutableData key="keyedArchiveRepresentation"> <mutableData key="keyedArchiveRepresentation">
YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI
ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T

View File

@ -10,7 +10,8 @@
#import "DualWindow.h" #import "DualWindow.h"
@interface MainWindow : DualWindow { @interface MainWindow : DualWindow {
IBOutlet NSMenuItem * itemLionSeparator;
IBOutlet NSMenuItem * itemLionFullscreenToggle;
} }
@end @end

View File

@ -19,7 +19,7 @@
[self setExcludedFromWindowsMenu:YES]; [self setExcludedFromWindowsMenu:YES];
[self setContentBorderThickness:24.0 forEdge:NSMinYEdge]; [self setContentBorderThickness:24.0 forEdge:NSMinYEdge];
[self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; [self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
} }
return self; return self;
} }
@ -30,10 +30,13 @@
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:[self hiddenDefaultsKey]]]; [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:[self hiddenDefaultsKey]]];
} }
if ([self respondsToSelector:@selector(toggleFullScreen:)])
{
[itemLionSeparator setHidden:NO];
[itemLionFullscreenToggle setHidden:NO];
}
[super awakeFromNib]; [super awakeFromNib];
} }
@end @end