Commit f287ebb1 authored by Daksh Shah's avatar Daksh Shah

Making the titleBar seemless

Issue #3
parent 62ec62cb
...@@ -64,6 +64,11 @@ ...@@ -64,6 +64,11 @@
- (void)setNonActive; - (void)setNonActive;
- (void)setVoutWasUpdated:(VLCWindow *)voutWindow; - (void)setVoutWasUpdated:(VLCWindow *)voutWindow;
- (void)fixTitleBar;
- (void)unFixTitleBar;
- (void)showTitleBar;
- (void)hideTitleBar;
- (void)setSeekable:(BOOL)seekable; - (void)setSeekable:(BOOL)seekable;
- (void)setVolumeLevel:(int)value; - (void)setVolumeLevel:(int)value;
- (void)updatePositionAndTime; - (void)updatePositionAndTime;
......
...@@ -233,6 +233,31 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect ...@@ -233,6 +233,31 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
[_mediaTitle setStringValue:title]; [_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 - (void)updatePositionAndTime
{ {
input_thread_t *p_input = pl_CurrentInput(getIntf()); input_thread_t *p_input = pl_CurrentInput(getIntf());
...@@ -420,6 +445,11 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect ...@@ -420,6 +445,11 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
if (!NSMouseInRect([NSEvent mouseLocation], [self.window frame], NO)) { if (!NSMouseInRect([NSEvent mouseLocation], [self.window frame], NO)) {
[self fadeOut]; [self fadeOut];
[self hideMouse]; [self hideMouse];
//Issue-3
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel hideTitleBar];
}];
} }
_isCounting = NO; _isCounting = NO;
} }
......
...@@ -710,9 +710,24 @@ static const float f_min_window_height = 307.; ...@@ -710,9 +710,24 @@ static const float f_min_window_height = 307.;
- (void)setVideoplayEnabled - (void)setVideoplayEnabled
{ {
NSLog(@"Hey there, check this out! :D");
BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback]; BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback];
//b_videoPlayback (here) is same as b_activeVideo (changePlaylistState)
if (!b_videoPlayback) { 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) { 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 // 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.; ...@@ -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 // restore alpha value to 1 for the case that macosx-opaqueness is set to < 1
[self setAlphaValue:1.0]; [self setAlphaValue:1.0];
} }
else{
if (self.nativeFullscreenMode) { NSLog(@"Active Video: %hhd, setting FullSize Window",b_videoPlayback);//Debug-Statement
if ([self hasActiveVideo] && [self fullscreen] && b_videoPlayback) { // self.styleMask |= NSFullSizeContentViewWindowMask;
[self hideControlsBar]; // [self hideControlsBar];
[self.fspanel setActive]; [[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
} else { [draggablepanel unFixTitleBar];
[self showControlsBar]; }];
[self.fspanel setNonActive];
}
} }
} }
......
...@@ -228,8 +228,21 @@ ...@@ -228,8 +228,21 @@
- (void)mouseMoved:(NSEvent *)o_event - (void)mouseMoved:(NSEvent *)o_event
{ {
NSPoint ml = [self convertPoint: [o_event locationInWindow] fromView: nil]; 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]; [[VLCMain sharedInstance] showFullscreenController];
}
[super mouseMoved: o_event]; [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