Commit 20bfa22b authored by Rafaël Carré's avatar Rafaël Carré

OSX GUI: simplify resizeWindow()

parent f4fb3707
...@@ -1245,27 +1245,24 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1245,27 +1245,24 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)resizeWindow - (void)resizeWindow
{ {
if ( !b_fullscreen && !(OSX_LION && [NSApp presentationOptions] == NSApplicationPresentationFullScreen && b_nativeFullscreenMode) ) if ( b_fullscreen || (OSX_LION && [NSApp presentationOptions] == NSApplicationPresentationFullScreen && b_nativeFullscreenMode) )
{ return;
NSPoint topleftbase;
NSPoint topleftscreen; NSPoint topleftbase = NSMakePoint(0, [self frame].size.height);
NSRect new_frame; NSPoint topleftscreen = [self convertBaseToScreen: topleftbase];
topleftbase.x = 0;
topleftbase.y = [self frame].size.height;
topleftscreen = [self convertBaseToScreen: topleftbase];
/* Calculate the window's new size */ /* Calculate the window's new size */
new_frame.size.width = [self frame].size.width - [o_video_view frame].size.width + nativeVideoSize.width; float w = [self frame].size.width - [o_video_view frame].size.width
+ nativeVideoSize.width;
float h = [self frame].size.height - [o_video_view frame].size.height
+ nativeVideoSize.height;
if (b_dark_interface) if (b_dark_interface)
new_frame.size.height = [self frame].size.height - [o_video_view frame].size.height + nativeVideoSize.height + [o_titlebar_view frame].size.height; h += [o_titlebar_view frame].size.height;
else
new_frame.size.height = [self frame].size.height - [o_video_view frame].size.height + nativeVideoSize.height;
new_frame.origin.x = topleftscreen.x; NSRect new_frame = NSMakeRect(topleftscreen.x, topleftscreen.y - h, w, h);
new_frame.origin.y = topleftscreen.y - new_frame.size.height;
[[self animator] setFrame:new_frame display:YES]; [[self animator] setFrame:new_frame display:YES];
}
} }
- (void)setNativeVideoSize:(NSSize)size - (void)setNativeVideoSize:(NSSize)size
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment