Commit cdb1a7b6 authored by David Fuhrmann's avatar David Fuhrmann

macosx: skip useless resize when starting video from minimal view (close #9510)

parent 8fdbf0f2
...@@ -119,8 +119,6 @@ ...@@ -119,8 +119,6 @@
- (void)toggleLeftSubSplitView; - (void)toggleLeftSubSplitView;
- (void)showDropZone; - (void)showDropZone;
- (void)hideDropZone; - (void)hideDropZone;
- (void)showSplitView;
- (void)hideSplitView;
- (void)updateTimeSlider; - (void)updateTimeSlider;
- (void)updateWindow; - (void)updateWindow;
- (void)updateName; - (void)updateName;
......
...@@ -373,7 +373,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -373,7 +373,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mainSplitViewDidResizeSubviews:) name: NSSplitViewDidResizeSubviewsNotification object:o_split_view]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(mainSplitViewDidResizeSubviews:) name: NSSplitViewDidResizeSubviewsNotification object:o_split_view];
if (b_splitviewShouldBeHidden) { if (b_splitviewShouldBeHidden) {
[self hideSplitView]; [self hideSplitView: YES];
i_lastSplitViewHeight = 300; i_lastSplitViewHeight = 300;
} }
...@@ -488,11 +488,11 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -488,11 +488,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
|| (b_nonembedded && sender != nil) || (b_nonembedded && sender != nil)
|| (!b_activeVideo && sender != nil) || (!b_activeVideo && sender != nil)
|| b_minimized_view)) || b_minimized_view))
[self hideSplitView]; [self hideSplitView: sender != nil];
else { else {
if (b_splitview_removed) { if (b_splitview_removed) {
if (!b_nonembedded || (sender != nil && b_nonembedded)) if (!b_nonembedded || (sender != nil && b_nonembedded))
[self showSplitView]; [self showSplitView: sender != nil];
if (sender == nil) if (sender == nil)
b_minimized_view = YES; b_minimized_view = YES;
...@@ -577,13 +577,16 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -577,13 +577,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[o_playlist_table animator] setHidden: NO]; [[o_playlist_table animator] setHidden: NO];
} }
- (void)hideSplitView - (void)hideSplitView:(BOOL)b_with_resize
{ {
NSRect winrect = [self frame]; if (b_with_resize) {
i_lastSplitViewHeight = [o_split_view frame].size.height; NSRect winrect = [self frame];
winrect.size.height = winrect.size.height - i_lastSplitViewHeight; i_lastSplitViewHeight = [o_split_view frame].size.height;
winrect.origin.y = winrect.origin.y + i_lastSplitViewHeight; winrect.size.height = winrect.size.height - i_lastSplitViewHeight;
[self setFrame: winrect display: YES animate: YES]; winrect.origin.y = winrect.origin.y + i_lastSplitViewHeight;
[self setFrame: winrect display: YES animate: YES];
}
[self performSelector:@selector(hideDropZone) withObject:nil afterDelay:0.1]; [self performSelector:@selector(hideDropZone) withObject:nil afterDelay:0.1];
if (b_dark_interface) { if (b_dark_interface) {
[self setContentMinSize: NSMakeSize(604., [o_controls_bar height] + [o_titlebar_view frame].size.height)]; [self setContentMinSize: NSMakeSize(604., [o_controls_bar height] + [o_titlebar_view frame].size.height)];
...@@ -596,7 +599,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -596,7 +599,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
b_splitview_removed = YES; b_splitview_removed = YES;
} }
- (void)showSplitView - (void)showSplitView:(BOOL)b_with_resize
{ {
[self updateWindow]; [self updateWindow];
if (b_dark_interface) if (b_dark_interface)
...@@ -605,11 +608,13 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -605,11 +608,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setContentMinSize:NSMakeSize(604., 288.)]; [self setContentMinSize:NSMakeSize(604., 288.)];
[self setContentMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)]; [self setContentMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
NSRect winrect; if (b_with_resize) {
winrect = [self frame]; NSRect winrect;
winrect.size.height = winrect.size.height + i_lastSplitViewHeight; winrect = [self frame];
winrect.origin.y = winrect.origin.y - i_lastSplitViewHeight; winrect.size.height = winrect.size.height + i_lastSplitViewHeight;
[self setFrame: winrect display: YES animate: YES]; winrect.origin.y = winrect.origin.y - i_lastSplitViewHeight;
[self setFrame: winrect display: YES animate: YES];
}
[self performSelector:@selector(resizePlaylistAfterCollapse) withObject: nil afterDelay:0.75]; [self performSelector:@selector(resizePlaylistAfterCollapse) withObject: nil afterDelay:0.75];
......
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