diff options
Diffstat (limited to 'Source/SPWindow.m')
-rw-r--r-- | Source/SPWindow.m | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/SPWindow.m b/Source/SPWindow.m index 39bed812..5563235f 100644 --- a/Source/SPWindow.m +++ b/Source/SPWindow.m @@ -33,6 +33,10 @@ #import "SPWindow.h" #import "SPWindowController.h" +@interface NSWindow (LionPlusMethods) +- (void)toggleFullScreen:(id)sender; +@end + @implementation SPWindow @synthesize isSheetWhichCanBecomeMain; @@ -165,4 +169,23 @@ return [super canBecomeMainWindow]; } +/** + * On 10.7+, allow the window to go fullscreen; do nothing on <10.7. + */ +- (void)toggleFullScreen:(id)sender +{ + if ([super respondsToSelector:@selector(toggleFullScreen:)]) { + [super toggleFullScreen:sender]; + } +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ + + if ([menuItem action] == @selector(toggleFullScreen:)) { + return ([super respondsToSelector:@selector(toggleFullScreen:)]); + } + return YES; +} + @end |