Commit 0f1e36e4 authored by David Fuhrmann's avatar David Fuhrmann

macosx: Remove unneeded frame manipulation code in main window

All of this code has no effect anymore, as autolayout is used
now.
parent 8ae3ae4f
......@@ -75,7 +75,6 @@
NSRect frameBeforePlayback;
}
- (void)resizePlaylistAfterCollapse;
- (void)makeSplitViewVisible;
- (void)makeSplitViewHidden;
- (void)showPodcastControls;
......@@ -176,9 +175,6 @@ static const float f_min_window_height = 307.;
[self reloadSidebar];
[_sidebarView selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO];
// Setup view frame sizes
[_dropzoneView setFrame:_playlistScrollView.frame];
[_splitViewLeft setFrame:_sidebarView.frame];
/*
* Set up translatable strings for the UI elements
......@@ -229,13 +225,6 @@ static const float f_min_window_height = 307.;
else
[self setContentMinSize:NSMakeSize(604., f_min_window_height)];
/* the default small size of the search field is slightly different on Lion, let's work-around that */
NSRect frame;
frame = [_searchField frame];
frame.origin.y = frame.origin.y + 2.0;
frame.size.height = frame.size.height - 1.0;
[_searchField setFrame:frame];
_fspanel = [[VLCFSPanelController alloc] init];
[_fspanel showWindow:self];
......@@ -266,7 +255,6 @@ static const float f_min_window_height = 307.;
[[self contentView] addSubview:o_color_backdrop positioned:NSWindowBelow relativeTo:_splitView];
[o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
} else {
[self.videoView setFrame:_splitView.frame];
[_playlistScrollView setBorderType:NSNoBorder];
[_sidebarScrollView setBorderType:NSNoBorder];
}
......@@ -282,7 +270,7 @@ static const float f_min_window_height = 307.;
}
/* sanity check for the window size */
frame = [self frame];
NSRect frame = [self frame];
NSSize screenSize = [[self screen] frame].size;
if (screenSize.width <= frame.size.width || screenSize.height <= frame.size.height) {
self.nativeVideoSize = screenSize;
......@@ -410,33 +398,6 @@ static const float f_min_window_height = 307.;
}
}
- (void)resizePlaylistAfterCollapse
{
// no animation here since we might be in the middle of another resize animation
NSRect rightSplitRect = [_splitViewRight frame];
NSRect plrect;
plrect.size.height = rightSplitRect.size.height - 20.0; // actual pl top bar height, which differs from its frame
plrect.size.width = rightSplitRect.size.width;
plrect.origin.x = plrect.origin.y = 0.;
NSRect dropzoneboxRect = _dropzoneBox.frame;
dropzoneboxRect.origin.x = (plrect.size.width - dropzoneboxRect.size.width) / 2;
dropzoneboxRect.origin.y = (plrect.size.height - dropzoneboxRect.size.height) / 2;
[_dropzoneView setFrame:plrect];
[_dropzoneBox setFrame:dropzoneboxRect];
if (b_podcastView_displayed) {
plrect.size.height -= [_podcastView frame].size.height;
plrect.origin.y = [_podcastView frame].size.height;
}
[_playlistScrollView setFrame:plrect];
[_dropzoneView setNeedsDisplay:YES];
[_playlistScrollView setNeedsDisplay:YES];
}
- (void)makeSplitViewVisible
{
if (self.darkInterface)
......@@ -608,9 +569,6 @@ static const float f_min_window_height = 307.;
- (void)hideSplitView:(BOOL)resize
{
// cancel pending pl resizes, in case of fast toggle between both modes
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resizePlaylistAfterCollapse) object:nil];
if (resize) {
NSRect winrect = [self frame];
f_lastSplitViewHeight = [_splitView frame].size.height;
......@@ -647,10 +605,6 @@ static const float f_min_window_height = 307.;
[self setFrame:winrect display:YES animate:YES];
}
// cancel pending pl resizes, in case of fast toggle between both modes
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resizePlaylistAfterCollapse) object:nil];
[self performSelector:@selector(resizePlaylistAfterCollapse) withObject: nil afterDelay:0.75];
b_splitview_removed = NO;
}
......@@ -839,32 +793,6 @@ static const float f_min_window_height = 307.;
}
}
#pragma mark -
#pragma mark Lion native fullscreen handling
- (void)windowWillEnterFullScreen:(NSNotification *)notification
{
[super windowWillEnterFullScreen:notification];
// update split view frame after removing title bar
if (self.darkInterface) {
NSRect frame = [[self contentView] frame];
frame.origin.y += [self.controlsBar height];
frame.size.height -= [self.controlsBar height];
[_splitView setFrame:frame];
}
}
- (void)windowWillExitFullScreen:(NSNotification *)notification
{
[super windowWillExitFullScreen: notification];
// update split view frame after readding title bar
if (self.darkInterface) {
NSRect frame = [_splitView frame];
frame.size.height -= [self.titlebarView frame].size.height;
[_splitView setFrame:frame];
}
}
#pragma mark -
#pragma mark Fullscreen support
......
......@@ -694,9 +694,6 @@
[self setFrame: winrect display:NO animate:NO];
}
// TODO remove
[_videoView setFrame: [[self contentView] frame]];
if (![_videoView isHidden]) {
[[self.controlsBar bottomBarView] setHidden: YES];
self.videoViewBottomConstraint.priority = 1;
......@@ -757,12 +754,6 @@
[self setFrame: winrect display:NO animate:NO];
}
// TODO remove
NSRect videoViewFrame = [_videoView frame];
videoViewFrame.origin.y += [self.controlsBar height];
videoViewFrame.size.height -= [self.controlsBar height];
[_videoView setFrame: videoViewFrame];
if (![_videoView isHidden]) {
[[self.controlsBar bottomBarView] setHidden: NO];
self.videoViewBottomConstraint.priority = 999;
......@@ -1063,6 +1054,8 @@
NSDisableScreenUpdates();
[_videoView removeFromSuperviewWithoutNeedingDisplay];
[[o_temp_view superview] replaceSubview:o_temp_view with:_videoView];
// TODO Replace tmpView by an existing view (e.g. middle view)
// TODO Use constraints for fullscreen window, reinstate constraints once the video view is added to the main window again
[_videoView setFrame:[o_temp_view frame]];
if ([[_videoView subviews] count] > 0)
[self makeFirstResponder: [[_videoView subviews] firstObject]];
......
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