[vlc-commits] [Git][videolan/vlc][master] 3 commits: macosx: Make volume slider also compress in library window controls bar

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Jul 5 09:26:11 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
92f61966 by Claudio Cambra at 2026-07-05T09:12:48+00:00
macosx: Make volume slider also compress in library window controls bar

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
99db635f by Claudio Cambra at 2026-07-05T09:12:48+00:00
macosx: Reduce size of volume slider in library window controls bar

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
5e824068 by Claudio Cambra at 2026-07-05T09:12:48+00:00
macosx: Hide jump forwards/backwards buttons in library window controls bar when narrow

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


5 changed files:

- modules/gui/macosx/UI/VLCLibraryWindow.xib
- modules/gui/macosx/library/VLCLibraryUIUnits.h
- modules/gui/macosx/library/VLCLibraryUIUnits.m
- modules/gui/macosx/windows/controlsbar/VLCControlsBarCommon.h
- modules/gui/macosx/windows/controlsbar/VLCControlsBarCommon.m


Changes:

=====================================
modules/gui/macosx/UI/VLCLibraryWindow.xib
=====================================
@@ -220,7 +220,7 @@
                                                     <constraint firstItem="5o7-Z0-dqS" firstAttribute="leading" secondItem="SM6-nx-NKD" secondAttribute="leading" id="vGw-cB-VLb"/>
                                                 </constraints>
                                             </customView>
-                                            <slider hidden="YES" horizontalHuggingPriority="200" verticalHuggingPriority="750" verticalCompressionResistancePriority="751" ambiguous="YES" mirrorLayoutDirectionWhenInternationalizing="never" translatesAutoresizingMaskIntoConstraints="NO" id="9Hg-t2-K5z" customClass="VLCPlaybackProgressSlider">
+                                            <slider hidden="YES" horizontalHuggingPriority="200" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="751" ambiguous="YES" mirrorLayoutDirectionWhenInternationalizing="never" translatesAutoresizingMaskIntoConstraints="NO" id="9Hg-t2-K5z" customClass="VLCPlaybackProgressSlider">
                                                 <rect key="frame" x="88" y="0.0" width="236" height="16"/>
                                                 <sliderCell key="cell" controlSize="mini" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.32600000000000001" tickMarkPosition="above" sliderType="linear" id="YMg-uo-8nX" customClass="VLCPlaybackProgressSliderCell"/>
                                                 <connections>
@@ -256,7 +256,7 @@
                                             <constraint firstItem="zOB-QJ-TUy" firstAttribute="leading" secondItem="SM6-nx-NKD" secondAttribute="trailing" constant="4" id="wML-fX-wuF"/>
                                         </constraints>
                                     </customView>
-                                    <stackView distribution="fillEqually" orientation="horizontal" alignment="centerY" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" ambiguous="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="S1K-Lp-DVO">
+                                    <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" ambiguous="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="S1K-Lp-DVO">
                                         <rect key="frame" x="612" y="5" width="188" height="40"/>
                                         <subviews>
                                             <button horizontalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="Bt8-jQ-hUr">
@@ -272,13 +272,14 @@
                                                     <action selector="toggleFavorite:" target="Uzf-Tf-H8x" id="5n0-gl-qS6"/>
                                                 </connections>
                                             </button>
-                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="i42-vp-ih7">
+                                            <customView horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="i42-vp-ih7">
                                                 <rect key="frame" x="21" y="0.0" width="146" height="40"/>
                                                 <subviews>
-                                                    <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="noz-yJ-oH4" customClass="VLCVolumeSlider">
-                                                        <rect key="frame" x="8" y="14" width="122" height="12"/>
+                                                    <slider verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="noz-yJ-oH4" customClass="VLCVolumeSlider">
+                                                        <rect key="frame" x="8" y="14" width="80" height="12"/>
                                                         <constraints>
-                                                            <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="48" id="EM2-Hh-lqK"/>
+                                                            <constraint firstAttribute="width" constant="80" priority="250" id="EM2-vol-width"/>
+                                                            <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="24" id="EM2-Hh-lqK"/>
                                                         </constraints>
                                                         <sliderCell key="cell" controlSize="mini" continuous="YES" alignment="left" maxValue="512" doubleValue="251.95348837209303" tickMarkPosition="above" sliderType="linear" id="IIu-VN-bEm" customClass="VLCVolumeSliderCell"/>
                                                         <connections>
@@ -357,7 +358,7 @@
                                     <constraint firstAttribute="bottom" secondItem="Ktr-qT-1fr" secondAttribute="bottom" constant="5" id="9pB-9C-2xy"/>
                                     <constraint firstAttribute="trailing" secondItem="S1K-Lp-DVO" secondAttribute="trailing" constant="10" id="BUG-PH-qrw"/>
                                     <constraint firstAttribute="bottom" secondItem="YAj-e7-KCU" secondAttribute="bottom" constant="5" id="Gqk-sg-bBK"/>
-                                    <constraint firstItem="S1K-Lp-DVO" firstAttribute="width" secondItem="YAj-e7-KCU" secondAttribute="width" id="NxM-eQ-3UW"/>
+                                    <constraint firstItem="S1K-Lp-DVO" firstAttribute="width" secondItem="YAj-e7-KCU" secondAttribute="width" priority="100" id="NxM-eQ-3UW"/>
                                     <constraint firstItem="Ktr-qT-1fr" firstAttribute="trailing" secondItem="S1K-Lp-DVO" secondAttribute="leading" constant="-16" id="hN9-7W-Mx1"/>
                                     <constraint firstAttribute="bottom" secondItem="S1K-Lp-DVO" secondAttribute="bottom" constant="5" id="qCf-Co-yI1"/>
                                     <constraint firstItem="YAj-e7-KCU" firstAttribute="top" secondItem="MQH-bI-Zdh" secondAttribute="top" constant="5" id="sIM-7y-JNq"/>
@@ -606,7 +607,11 @@
                 <outlet property="forwardButton" destination="dPD-MZ-5oT" id="btH-v5-s7F"/>
                 <outlet property="fullscreenButton" destination="dwM-Uz-pAw" id="gXA-WS-Gig"/>
                 <outlet property="jumpBackwardButton" destination="72A-6S-lpR" id="YRk-DB-K28"/>
+                <outlet property="jumpBackwardButtonSpacingConstraint" destination="wzB-TW-knV" id="jbs-sp-c"/>
+                <outlet property="jumpBackwardButtonWidthConstraint" destination="q77-Gr-cho" id="jbw-w-c"/>
                 <outlet property="jumpForwardButton" destination="pAd-ve-EeL" id="iBO-a8-WA6"/>
+                <outlet property="jumpForwardButtonSpacingConstraint" destination="S8H-lo-eeW" id="jfs-sp-c"/>
+                <outlet property="jumpForwardButtonWidthConstraint" destination="ASs-Ko-yKD" id="jfw-w-c"/>
                 <outlet property="muteVolumeButton" destination="IAy-58-UPp" id="dDN-pE-Vmj"/>
                 <outlet property="openMainVideoViewButtonOverlay" destination="CzG-0S-Kke" id="6BY-BQ-72f"/>
                 <outlet property="playButton" destination="WgO-zh-k4s" id="0yC-Yh-H4V"/>


=====================================
modules/gui/macosx/library/VLCLibraryUIUnits.h
=====================================
@@ -85,6 +85,7 @@ extern NSString * const VLCLibraryCollectionViewItemAdjustmentKey;
 @property (class, readonly) const CGFloat controlsFadeAnimationDuration;
 
 @property (class, readonly) const CGFloat libraryWindowControlsBarHeight;
+ at property (class, readonly) const CGFloat libraryWindowControlsBarNarrowWidthThreshold;
 
 @property (class, readonly) const CGFloat librarySplitViewSelectionViewDefaultWidth;
 @property (class, readonly) const CGFloat librarySplitViewMainViewMinimumWidth;


=====================================
modules/gui/macosx/library/VLCLibraryUIUnits.m
=====================================
@@ -296,6 +296,11 @@ NSString * const VLCLibraryCollectionViewItemAdjustmentKey = @"VLCLibraryCollect
     return 48.;
 }
 
++ (const CGFloat)libraryWindowControlsBarNarrowWidthThreshold
+{
+    return 600.;
+}
+
 + (const CGFloat)libraryWindowNavSidebarMinWidth
 {
     return 180.;


=====================================
modules/gui/macosx/windows/controlsbar/VLCControlsBarCommon.h
=====================================
@@ -47,6 +47,11 @@
 @property (readwrite, strong) IBOutlet NSButton *jumpBackwardButton;
 @property (readwrite, strong) IBOutlet NSButton *jumpForwardButton;
 
+ at property (readwrite, weak) IBOutlet NSLayoutConstraint *jumpBackwardButtonWidthConstraint;
+ at property (readwrite, weak) IBOutlet NSLayoutConstraint *jumpForwardButtonWidthConstraint;
+ at property (readwrite, weak) IBOutlet NSLayoutConstraint *jumpBackwardButtonSpacingConstraint;
+ at property (readwrite, weak) IBOutlet NSLayoutConstraint *jumpForwardButtonSpacingConstraint;
+
 @property (readwrite, strong) IBOutlet VLCPlaybackProgressSlider *timeSlider;
 @property (readwrite, strong) IBOutlet VLCVolumeSlider *volumeSlider;
 @property (readwrite, strong) IBOutlet NSButton *muteVolumeButton;


=====================================
modules/gui/macosx/windows/controlsbar/VLCControlsBarCommon.m
=====================================
@@ -32,6 +32,7 @@
 #import "playqueue/VLCPlayQueueModel.h"
 #import "playqueue/VLCPlayerController.h"
 #import "library/VLCInputItem.h"
+#import "library/VLCLibraryUIUnits.h"
 
 #import "views/VLCBottomBarView.h"
 #import "views/VLCDragDropView.h"
@@ -67,6 +68,12 @@
 
     VLCPlayQueueController *_playQueueController;
     VLCPlayerController *_playerController;
+
+    BOOL _jumpButtonsHidden;
+    CGFloat _jumpBackwardButtonOriginalWidth;
+    CGFloat _jumpForwardButtonOriginalWidth;
+    CGFloat _jumpBackwardButtonOriginalSpacing;
+    CGFloat _jumpForwardButtonOriginalSpacing;
 }
 @end
 
@@ -262,6 +269,18 @@
 
     // Update verything post-init
     [self update];
+
+    _jumpBackwardButtonOriginalWidth = self.jumpBackwardButtonWidthConstraint.constant;
+    _jumpForwardButtonOriginalWidth = self.jumpForwardButtonWidthConstraint.constant;
+    _jumpBackwardButtonOriginalSpacing = self.jumpBackwardButtonSpacingConstraint.constant;
+    _jumpForwardButtonOriginalSpacing = self.jumpForwardButtonSpacingConstraint.constant;
+
+    self.dropView.postsFrameChangedNotifications = YES;
+    [NSNotificationCenter.defaultCenter addObserver:self
+                                           selector:@selector(dropViewFrameChanged:)
+                                               name:NSViewFrameDidChangeNotification
+                                             object:self.dropView];
+    [self updateJumpButtonVisibilityForWidth:self.dropView.frame.size.width];
 }
 
 - (void)dealloc
@@ -269,6 +288,34 @@
     [NSNotificationCenter.defaultCenter removeObserver:self];
 }
 
+- (void)dropViewFrameChanged:(NSNotification *)notification
+{
+    [self updateJumpButtonVisibilityForWidth:self.dropView.frame.size.width];
+}
+
+- (void)updateJumpButtonVisibilityForWidth:(CGFloat)width
+{
+    const CGFloat narrowThreshold = VLCLibraryUIUnits.libraryWindowControlsBarNarrowWidthThreshold;
+
+    if (!_jumpButtonsHidden && width < narrowThreshold) {
+        _jumpButtonsHidden = YES;
+        self.jumpBackwardButton.hidden = YES;
+        self.jumpForwardButton.hidden = YES;
+        self.jumpBackwardButtonWidthConstraint.constant = 0;
+        self.jumpForwardButtonWidthConstraint.constant = 0;
+        self.jumpBackwardButtonSpacingConstraint.constant = 0;
+        self.jumpForwardButtonSpacingConstraint.constant = 0;
+    } else if (_jumpButtonsHidden && width >= narrowThreshold) {
+        _jumpButtonsHidden = NO;
+        self.jumpBackwardButton.hidden = NO;
+        self.jumpForwardButton.hidden = NO;
+        self.jumpBackwardButtonWidthConstraint.constant = _jumpBackwardButtonOriginalWidth;
+        self.jumpForwardButtonWidthConstraint.constant = _jumpForwardButtonOriginalWidth;
+        self.jumpBackwardButtonSpacingConstraint.constant = _jumpBackwardButtonOriginalSpacing;
+        self.jumpForwardButtonSpacingConstraint.constant = _jumpForwardButtonOriginalSpacing;
+    }
+}
+
 - (CGFloat)height
 {
     return self.bottomBarView.frame.size.height;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/fe6e76a9060aa7982e24bf5c8931be5c5bf4f7e7...5e8240680e59e604ab81def2dec769ad54da5d55

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/fe6e76a9060aa7982e24bf5c8931be5c5bf4f7e7...5e8240680e59e604ab81def2dec769ad54da5d55
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




More information about the vlc-commits mailing list