Browse Source

macosx: Don't hide video controls if mouse is hovering on them

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/144/head
Claudio Cambra 3 years ago
committed by Steve Lhomme
parent
commit
12f34b7ecd
  1. 1
      modules/gui/macosx/UI/VLCMainVideoView.xib
  2. 1
      modules/gui/macosx/windows/video/VLCMainVideoViewController.h
  3. 12
      modules/gui/macosx/windows/video/VLCMainVideoViewController.m

1
modules/gui/macosx/UI/VLCMainVideoView.xib

@ -9,6 +9,7 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCMainVideoViewController">
<connections>
<outlet property="centralControlsStackView" destination="CvV-yX-Nbh" id="zyI-Rb-bem"/>
<outlet property="controlsBar" destination="3" id="Mfq-2w-2uR"/>
<outlet property="mainControlsView" destination="D4V-Zd-qvB" id="KwM-ya-ETn"/>
<outlet property="playlistButton" destination="Drq-if-dw4" id="BZe-Cr-mzZ"/>

1
modules/gui/macosx/windows/video/VLCMainVideoViewController.h

@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, strong) IBOutlet VLCVoutView *voutView;
@property (readwrite, strong) IBOutlet NSBox *mainControlsView;
@property (readwrite, strong) IBOutlet NSStackView *centralControlsStackView;
@property (readwrite, strong) IBOutlet VLCControlsBarCommon *controlsBar;
@property (readwrite, strong) IBOutlet NSButton *returnButton;
@property (readwrite, strong) IBOutlet NSButton *playlistButton;

12
modules/gui/macosx/windows/video/VLCMainVideoViewController.m

@ -88,6 +88,18 @@
- (void)hideControls:(id)sender
{
[self stopAutohideTimer];
NSPoint mousePos = [self.view.window mouseLocationOutsideOfEventStream];
if ([_centralControlsStackView mouse:mousePos inRect:_centralControlsStackView.frame] ||
[_controlsBar.bottomBarView mouse:mousePos inRect: _controlsBar.bottomBarView.frame]) {
// If the mouse is on the controls let's not hide, and make sure to tell other hideable
// controls elsewhere to show themselves
[NSNotificationCenter.defaultCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController
object:self];
return;
}
_mainControlsView.hidden = YES;
}

Loading…
Cancel
Save