diff options
author | Ton Roosendaal <ton@blender.org> | 2013-03-22 20:11:00 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2013-03-22 20:11:00 +0400 |
commit | 6690d2abddfec9937615a5aa10ef6e86cda904f4 (patch) | |
tree | 1a8d112b502b3142a15e13dc9bc7bc697ce19796 /intern | |
parent | cb1d26d7942290c89dabf7d1f2d42485a2adc4b0 (diff) |
OSX feature:
Blender now supports the 10.7+ "Full screen" mode, which pushes a window to a permanent
other "screen", with animated zoom and sliding.
Available via the icon in window header (right), Apple+F, or "Window" menu in top.
Works much nicer than Blender's own "full screen" option.
Todo: the zoom effect is still draws a bit ugly, because Blender doesn't have "live resize"
yet.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 12 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 6fcd0d91779..02abf7650e5 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -500,6 +500,7 @@ int cocoa_request_qtcodec_settings(bContext *C, wmOperator *op) - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; - (void)applicationWillTerminate:(NSNotification *)aNotification; - (void)applicationWillBecomeActive:(NSNotification *)aNotification; +- (void)toggleFullScreen:(NSNotification *)notification; @end @implementation CocoaAppDelegate : NSObject @@ -536,10 +537,16 @@ int cocoa_request_qtcodec_settings(bContext *C, wmOperator *op) { systemCocoa->handleApplicationBecomeActiveEvent(); } + +- (void)toggleFullScreen:(NSNotification *)notification +{ +} + @end + #pragma mark initialization/finalization const char *user_locale; // Global current user locale @@ -655,6 +662,11 @@ GHOST_TSuccess GHOST_SystemCocoa::init() [windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""]; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + menuItem = [windowMenu addItemWithTitle:@"Enter Full Screen" action:@selector(toggleFullScreen:) keyEquivalent:@"f" ]; + [menuItem setKeyEquivalentModifierMask:NSCommandKeyMask]; +#endif + menuItem = [windowMenu addItemWithTitle:@"Close" action:@selector(performClose:) keyEquivalent:@"w"]; [menuItem setKeyEquivalentModifierMask:NSCommandKeyMask]; diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 6517e3fb9f9..5a79fcf52bc 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -622,7 +622,12 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( [m_window registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, NSStringPboardType, NSTIFFPboardType, nil]]; - + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + [NSApp setPresentationOptions:(NSApplicationPresentationFullScreen)]; + [m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; +#endif + if (state == GHOST_kWindowStateFullScreen) setState(GHOST_kWindowStateFullScreen); |