Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits: e282270b by Claudio Cambra at 2026-06-09T07:45:59+02:00 macosx: Modify VLCTrackingView to support showing/hiding multiple views Signed-off-by: Claudio Cambra <[email protected]> - - - - - 135b3b80 by Claudio Cambra at 2026-06-09T07:45:59+02:00 macosx: Also hide 3-dot enqueing button on collection view items until hover Signed-off-by: Claudio Cambra <[email protected]> - - - - - 4 changed files: - modules/gui/macosx/library/VLCLibraryCollectionViewItem.m - modules/gui/macosx/library/VLCLibraryWindow.m - modules/gui/macosx/views/VLCTrackingView.h - modules/gui/macosx/views/VLCTrackingView.m Changes: ===================================== modules/gui/macosx/library/VLCLibraryCollectionViewItem.m ===================================== @@ -144,7 +144,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95; #endif } - [(VLCTrackingView *)self.view setViewToHide:self.playInstantlyButton]; + [(VLCTrackingView *)self.view setViewsToHide:@[self.playInstantlyButton, self.addToPlayQueueButton]]; self.secondaryInfoTextField.textColor = NSColor.VLClibrarySubtitleColor; self.annotationTextField.font = NSFont.VLCLibraryItemAnnotationFont; self.annotationTextField.textColor = NSColor.VLClibraryAnnotationColor; @@ -181,7 +181,8 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95; - (void)prepareForReuse { [super prepareForReuse]; - _playInstantlyButton.hidden = YES; + self.playInstantlyButton.hidden = YES; + self.addToPlayQueueButton.hidden = YES; _mediaTitleTextField.stringValue = @""; _secondaryInfoTextField.stringValue = [NSString stringWithTime:0]; _mediaImageView.image = nil; ===================================== modules/gui/macosx/library/VLCLibraryWindow.m ===================================== @@ -470,7 +470,9 @@ static int ShowController(vlc_object_t * __unused p_this, self.artworkButton.enabled = !artworkButtonDisabled; self.artworkButton.hidden = artworkButtonDisabled; self.controlsBar.thumbnailTrackingView.enabled = !artworkButtonDisabled; - self.controlsBar.thumbnailTrackingView.viewToHide.hidden = artworkButtonDisabled; + for (NSView * const view in self.controlsBar.thumbnailTrackingView.viewsToHide) { + view.hidden = artworkButtonDisabled; + } } - (void)configureArtworkButtonLiveVideoView ===================================== modules/gui/macosx/views/VLCTrackingView.h ===================================== @@ -30,11 +30,14 @@ typedef void(^EnterExitBlock)(void); @property (readwrite) BOOL enabled; @property (readwrite) BOOL animatesTransition; -@property (readwrite, assign, nullable) NSView *viewToHide; // Hide when mouse out -@property (readwrite, assign, nullable) NSView *viewToShow; // Show when mouse out +@property (readwrite, strong, nullable) NSArray<NSView *> *viewsToHide; // Hide when mouse out +@property (readwrite, strong, nullable) NSArray<NSView *> *viewsToShow; // Show when mouse out @property (readwrite, strong, nullable) EnterExitBlock mouseEnteredBlock; @property (readwrite, strong, nullable) EnterExitBlock mouseExitedBlock; +- (void)setViewToHide:(nullable NSView *)view; +- (void)setViewToShow:(nullable NSView *)view; + @end NS_ASSUME_NONNULL_END ===================================== modules/gui/macosx/views/VLCTrackingView.m ===================================== @@ -65,6 +65,16 @@ _enabled = YES; } +- (void)setViewToHide:(nullable NSView *)view +{ + self.viewsToHide = view ? @[view] : nil; +} + +- (void)setViewToShow:(nullable NSView *)view +{ + self.viewsToShow = view ? @[view] : nil; +} + - (void)performTransition { if (self.animatesTransition) { @@ -72,26 +82,42 @@ const BOOL hideVTS = _mouseIn; const BOOL startMouseIn = _mouseIn; - __weak typeof(self.viewToHide) weakViewToHide = self.viewToHide; - __weak typeof(self.viewToShow) weakViewToShow = self.viewToShow; + __weak typeof(self) weakSelf = self; - weakViewToHide.hidden = NO; - weakViewToShow.hidden = NO; + for (NSView * const view in self.viewsToHide) { + view.hidden = NO; + } + for (NSView * const view in self.viewsToShow) { + view.hidden = NO; + } [NSAnimationContext runAnimationGroup:^(NSAnimationContext * const context){ NSAnimationContext.currentContext.duration = 0.3; - weakViewToHide.animator.alphaValue = hideVTH ? 0.0 : 1.0; - weakViewToShow.animator.alphaValue = hideVTS ? 0.0 : 1.0; + for (NSView * const view in weakSelf.viewsToHide) { + view.animator.alphaValue = hideVTH ? 0.0 : 1.0; + } + for (NSView * const view in weakSelf.viewsToShow) { + view.animator.alphaValue = hideVTS ? 0.0 : 1.0; + } } completionHandler:^{ - if (startMouseIn != self->_mouseIn) { + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf || startMouseIn != strongSelf->_mouseIn) { return; } - weakViewToHide.hidden = hideVTH; - weakViewToShow.hidden = hideVTS; + for (NSView * const view in strongSelf.viewsToHide) { + view.hidden = hideVTH; + } + for (NSView * const view in strongSelf.viewsToShow) { + view.hidden = hideVTS; + } }]; } else { - self.viewToHide.hidden = !_mouseIn; - self.viewToShow.hidden = _mouseIn; + for (NSView * const view in self.viewsToHide) { + view.hidden = !_mouseIn; + } + for (NSView * const view in self.viewsToShow) { + view.hidden = _mouseIn; + } } } View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/84db002877000d02e985c6cbcde6026626fc35ff...135b3b80bb4340ece64bb2e5263add7c9f48e9cf -- View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/84db002877000d02e985c6cbcde6026626fc35ff...135b3b80bb4340ece64bb2e5263add7c9f48e9cf You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
_______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
