Commit f287ebb1 authored by Daksh Shah's avatar Daksh Shah

Making the titleBar seemless

Issue #3
parent 62ec62cb
......@@ -64,6 +64,11 @@
- (void)setNonActive;
- (void)setVoutWasUpdated:(VLCWindow *)voutWindow;
- (void)fixTitleBar;
- (void)unFixTitleBar;
- (void)showTitleBar;
- (void)hideTitleBar;
- (void)setSeekable:(BOOL)seekable;
- (void)setVolumeLevel:(int)value;
- (void)updatePositionAndTime;
......
......@@ -233,6 +233,31 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
[_mediaTitle setStringValue:title];
}
- (void)fixTitleBar
{
//Issue-3, the titleBar should be shown/hidden only for the respective window of FSPanel...
_associatedVoutWindow.styleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
| NSMiniaturizableWindowMask;
[self showTitleBar];
//[_associatedVoutWindow showControlsBar]; //It apparently does not have showControlsBar, because it is a NSWindow... would have to figure out a way to hide/show it
}
-(void)unFixTitleBar
{
_associatedVoutWindow.styleMask |= NSFullSizeContentViewWindowMask;
}
- (void)showTitleBar
{
[[[[_associatedVoutWindow standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1];
}
- (void)hideTitleBar
{
[[[[_associatedVoutWindow standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:0];
}
- (void)updatePositionAndTime
{
input_thread_t *p_input = pl_CurrentInput(getIntf());
......@@ -420,6 +445,11 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
if (!NSMouseInRect([NSEvent mouseLocation], [self.window frame], NO)) {
[self fadeOut];
[self hideMouse];
//Issue-3
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel hideTitleBar];
}];
}
_isCounting = NO;
}
......
......@@ -710,9 +710,24 @@ static const float f_min_window_height = 307.;
- (void)setVideoplayEnabled
{
NSLog(@"Hey there, check this out! :D");
BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback];
//b_videoPlayback (here) is same as b_activeVideo (changePlaylistState)
if (!b_videoPlayback) {
msg_Err(getIntf(), "Going from VIDEO TO PLAYLIST");//Debug-Statement
NSLog(@"Active Video: %hhd, setting Titled Window",b_videoPlayback);//Debug-Statement
//Issue-3
// self.styleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
// | NSMiniaturizableWindowMask;
// [[[[[[VLCMain sharedInstance] mainWindow] standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1];
// [self showControlsBar];
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel fixTitleBar];
}];
if (!self.nonembedded && (!self.nativeFullscreenMode || (self.nativeFullscreenMode && !self.fullscreen)) && frameBeforePlayback.size.width > 0 && frameBeforePlayback.size.height > 0) {
// only resize back to minimum view of this is still desired final state
......@@ -740,15 +755,13 @@ static const float f_min_window_height = 307.;
// restore alpha value to 1 for the case that macosx-opaqueness is set to < 1
[self setAlphaValue:1.0];
}
if (self.nativeFullscreenMode) {
if ([self hasActiveVideo] && [self fullscreen] && b_videoPlayback) {
[self hideControlsBar];
[self.fspanel setActive];
} else {
[self showControlsBar];
[self.fspanel setNonActive];
}
else{
NSLog(@"Active Video: %hhd, setting FullSize Window",b_videoPlayback);//Debug-Statement
// self.styleMask |= NSFullSizeContentViewWindowMask;
// [self hideControlsBar];
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel unFixTitleBar];
}];
}
}
......
......@@ -228,8 +228,21 @@
- (void)mouseMoved:(NSEvent *)o_event
{
NSPoint ml = [self convertPoint: [o_event locationInWindow] fromView: nil];
if ([self mouse: ml inRect: [self bounds]])
if ([self mouse: ml inRect: [self bounds]]){
//NSLog(@"VLCVoutView mouseMoved");//Debug-Statement
//It is triggered only in the Video Playing windows, not Playlist view, which is perfect
//Issue-3
// [[[[[[VLCMain sharedInstance] mainWindow] standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1];
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel showTitleBar];
}];
//[[VLCMain sharedInstance] mainWindow].titlebarAppearsTransparent = false;//<seems unneccesary
[[VLCMain sharedInstance] showFullscreenController];
}
[super mouseMoved: o_event];
}
......
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