Commit 7f85575c authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix video view and bottom bar framings

... to allow toggling between playlist and video view in lion
fullscreen mode.

close #8496
parent e9f12b9e
......@@ -69,6 +69,8 @@
@property (readonly) id bottomBarView;
- (CGFloat)height;
- (IBAction)play:(id)sender;
- (IBAction)bwd:(id)sender;
- (IBAction)fwd:(id)sender;
......
......@@ -158,6 +158,11 @@
}
- (CGFloat)height
{
return [o_bottombar_view frame].size.height;
}
#pragma mark -
#pragma mark Button Actions
......
......@@ -438,6 +438,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_video_view setHidden: YES];
[o_split_view setHidden: NO];
if ([self fullscreen]) {
[[o_controls_bar bottomBarView] setHidden: NO];
[o_fspanel setNonActive:nil];
}
[self makeFirstResponder: nil];
}
......@@ -451,6 +456,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_split_view setHidden: YES];
[o_video_view setHidden: NO];
if ([self fullscreen]) {
[[o_controls_bar bottomBarView] setHidden: YES];
[o_fspanel setActive:nil];
}
if ([[o_video_view subviews] count] > 0)
[self makeFirstResponder: [[o_video_view subviews] objectAtIndex:0]];
......@@ -467,11 +476,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
BOOL b_activeVideo = [[VLCMain sharedInstance] activeVideoPlayback];
BOOL b_restored = NO;
// TODO: implement toggle playlist in this situation (triggerd via menu item).
// but for now we block this case, to avoid displaying only the half
if (b_nativeFullscreenMode && b_fullscreen && b_activeVideo && sender != nil)
return;
BOOL b_have_alt_key = ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0;
if (sender && [sender isKindOfClass: [NSMenuItem class]])
b_have_alt_key = NO;
......@@ -775,7 +779,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
[super windowWillEnterFullScreen:notification];
// update split view frame after removing title bar
[o_split_view setFrame: [o_video_view frame]];
if (b_dark_interface) {
NSRect frame = [[self contentView] frame];
frame.origin.y += [o_controls_bar height];
frame.size.height -= [o_controls_bar height];
[o_split_view setFrame:frame];
}
}
- (void)windowWillExitFullScreen:(NSNotification *)notification
......@@ -783,7 +792,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
[super windowWillExitFullScreen: notification];
// update split view frame after readding title bar
[o_split_view setFrame: [o_video_view frame]];
if (b_dark_interface) {
NSRect frame = [o_split_view frame];
frame.size.height -= [o_titlebar_view frame].size.height;
[o_split_view setFrame:frame];
}
}
#pragma mark -
#pragma mark Fullscreen support
......@@ -793,7 +806,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
id currentWindow = [NSApp keyWindow];
if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && [currentWindow hasActiveVideo]) {
if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen]) {
if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) {
if ([[VLCMain sharedInstance] activeVideoPlayback])
[o_fspanel fadeIn];
......
......@@ -618,9 +618,9 @@
}
}
[o_video_view setFrame: [[self contentView] frame]];
if ([self hasActiveVideo])
[[VLCMainWindow sharedInstance] recreateHideMouseTimer];
[[VLCMainWindow sharedInstance] recreateHideMouseTimer];
i_originalLevel = [self level];
[[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: NSNormalWindowLevel];
[self setLevel:NSNormalWindowLevel];
......@@ -636,9 +636,11 @@
[self setFrame: winrect display:NO animate:NO];
}
// TODO fix bottom bar status when vout just not visible, but there
if (![o_video_view isHidden])
[o_video_view setFrame: [[self contentView] frame]];
if (![o_video_view isHidden]) {
[[o_controls_bar bottomBarView] setHidden: YES];
}
[self setMovableByWindowBackground: NO];
}
......@@ -654,7 +656,8 @@
if ([self hasActiveVideo]) {
[[[VLCMainWindow sharedInstance] fsPanel] setVoutWasUpdated: self];
[[[VLCMainWindow sharedInstance] fsPanel] setActive: nil];
if (![o_video_view isHidden])
[[[VLCMainWindow sharedInstance] fsPanel] setActive: nil];
}
NSArray *subviews = [[self videoView] subviews];
......@@ -690,24 +693,28 @@
if (b_dark_interface) {
NSRect winrect;
CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
winrect = [self frame];
winrect = [o_video_view frame];
winrect.size.height -= f_titleBarHeight;
[o_video_view setFrame: winrect];
winrect = [self frame];
[o_titlebar_view setFrame: NSMakeRect(0, winrect.size.height - f_titleBarHeight,
winrect.size.width, f_titleBarHeight)];
[[self contentView] addSubview: o_titlebar_view];
winrect.size.height = winrect.size.height + f_titleBarHeight;
[self setFrame: winrect display:NO animate:NO];
winrect = [o_video_view frame];
winrect.size.height -= f_titleBarHeight;
[o_video_view setFrame: winrect];
}
NSRect videoViewFrame = [o_video_view frame];
videoViewFrame.origin.y = [[o_controls_bar bottomBarView] frame].size.height;
videoViewFrame.size.height -= [[o_controls_bar bottomBarView] frame].size.height;
videoViewFrame.origin.y += [o_controls_bar height];
videoViewFrame.size.height -= [o_controls_bar height];
[o_video_view setFrame: videoViewFrame];
[[o_controls_bar bottomBarView] setHidden: NO];
if (![o_video_view isHidden]) {
[[o_controls_bar bottomBarView] setHidden: NO];
}
[self setMovableByWindowBackground: YES];
}
......
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