Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
93861639 by Claudio Cambra at 2024-02-08T17:02:13+00:00
macosx: Add layout constraint for library window bottom control bar height

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
50aab37b by Claudio Cambra at 2024-02-08T17:02:13+00:00
macosx: Animate appear and disappear of library controls bar

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
2ad3971f by Claudio Cambra at 2024-02-08T17:02:13+00:00
macosx: Improve library window controls bar show/hide animation

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
1a3ced3a by Claudio Cambra at 2024-02-08T17:02:13+00:00
macosx: Set visual effect view for library window controls bar blending behind 
window

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
be8b4365 by Claudio Cambra at 2024-02-08T17:02:13+00:00
macosx: Remove unused constraints

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
2f13f6e0 by Claudio Cambra at 2024-02-08T17:02:13+00:00
macosx: Immediately hide controls bar when enabling video view

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
f16e9b02 by Claudio Cambra at 2024-02-08T17:02:13+00:00
macosx: Do not use magic numbers for library window controls bar hide and show

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -


5 changed files:

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


Changes:

=====================================
modules/gui/macosx/UI/VLCLibraryWindow.xib
=====================================
@@ -270,8 +270,8 @@
                             <real value="250"/>
                         </holdingPriorities>
                     </splitView>
-                    <visualEffectView blendingMode="withinWindow" 
material="titlebar" state="followsWindowActiveState" 
translatesAutoresizingMaskIntoConstraints="NO" id="vUy-jt-gjY" 
customClass="VLCBottomBarView">
-                        <rect key="frame" x="0.0" y="0.0" width="896" 
height="45"/>
+                    <visualEffectView blendingMode="behindWindow" 
material="sidebar" state="followsWindowActiveState" 
translatesAutoresizingMaskIntoConstraints="NO" id="vUy-jt-gjY" 
customClass="VLCBottomBarView">
+                        <rect key="frame" x="0.0" y="0.0" width="896" 
height="48"/>
                         <subviews>
                             <customView 
translatesAutoresizingMaskIntoConstraints="NO" id="MQH-bI-Zdh" 
customClass="VLCDragDropView">
                                 <rect key="frame" x="0.0" y="0.0" width="896" 
height="45"/>
@@ -563,6 +563,7 @@
                             </customView>
                         </subviews>
                         <constraints>
+                            <constraint firstAttribute="height" constant="48" 
id="Fps-hR-AFq"/>
                             <constraint firstAttribute="bottom" 
secondItem="MQH-bI-Zdh" secondAttribute="bottom" id="Uo1-sD-OXk"/>
                             <constraint firstItem="MQH-bI-Zdh" 
firstAttribute="leading" secondItem="vUy-jt-gjY" secondAttribute="leading" 
id="YVB-nY-sHE"/>
                             <constraint firstAttribute="trailing" 
secondItem="MQH-bI-Zdh" secondAttribute="trailing" id="aBH-H2-ykp"/>
@@ -594,7 +595,6 @@
                 </subviews>
                 <constraints>
                     <constraint firstItem="6gW-0d-ymm" firstAttribute="top" 
secondItem="u8g-jy-S4e" secondAttribute="top" id="33P-it-9HX"/>
-                    <constraint firstAttribute="bottom" 
secondItem="u8g-jy-S4e" secondAttribute="bottom" priority="250" 
id="DQQ-ji-YSy"/>
                     <constraint firstItem="6gW-0d-ymm" 
firstAttribute="trailing" secondItem="iSp-bV-w6B" secondAttribute="trailing" 
id="DZK-gL-4Jh"/>
                     <constraint firstItem="vUy-jt-gjY" firstAttribute="top" 
secondItem="u8g-jy-S4e" secondAttribute="bottom" id="QH8-mU-6ZP"/>
                     <constraint firstItem="vUy-jt-gjY" 
firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" 
id="Sse-bx-ewr"/>
@@ -759,6 +759,7 @@
                 <outlet property="clearPlaylistButton" 
destination="cih-xp-HmY" id="PoU-co-0kn"/>
                 <outlet property="clearPlaylistSeparator" 
destination="nAW-KH-ipk" id="Af9-fg-u7m"/>
                 <outlet property="controlsBar" destination="Uzf-Tf-H8x" 
id="n0G-92-F2Q"/>
+                <outlet property="controlsBarHeightConstraint" 
destination="Fps-hR-AFq" id="E4g-JQ-fgx"/>
                 <outlet property="dragDropImageBackgroundBox" 
destination="AXk-h7-dZ0" id="h3h-Wh-0op"/>
                 <outlet property="emptyLibraryView" destination="YJf-1r-vaC" 
id="AJB-eN-4u6"/>
                 <outlet property="flexibleSpaceToolbarItem" 
destination="89f-AL-zuU" id="3p9-t8-79g"/>
@@ -801,7 +802,6 @@
                 <outlet property="shufflePlaylistButton" 
destination="jg5-33-vH0" id="FV2-36-3lG"/>
                 <outlet property="sortOrderToolbarItem" 
destination="Tbc-Ik-FaO" id="098-yp-97f"/>
                 <outlet property="splitViewBottomConstraintToBottomBar" 
destination="QH8-mU-6ZP" id="b0t-C0-N5t"/>
-                <outlet property="splitViewBottomConstraintToSuperView" 
destination="DQQ-ji-YSy" id="b0t-C0-5uP"/>
                 <outlet property="togglePlaylistToolbarItem" 
destination="Lf2-ec-tHh" id="gtf-cd-765"/>
                 <outlet property="upNextLabel" destination="TET-5r-zHx" 
id="3oI-LK-NDP"/>
                 <outlet property="upNextSeparator" destination="qmL-Ar-cj1" 
id="GRX-ZE-2UG"/>


=====================================
modules/gui/macosx/library/VLCLibraryUIUnits.h
=====================================
@@ -62,6 +62,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (class, readonly) const CGFloat controlsFadeAnimationDuration;
 
+@property (class, readonly) const CGFloat libraryWindowControlsBarHeight;
+
 @property (class, readonly) const CGFloat librarySplitViewMainViewMinimumWidth;
 
 + (const 
NSSize)adjustedCollectionViewItemSizeForCollectionView:(NSCollectionView 
*)collectionView


=====================================
modules/gui/macosx/library/VLCLibraryUIUnits.m
=====================================
@@ -186,4 +186,9 @@
     return 400.;
 }
 
++ (const CGFloat)libraryWindowControlsBarHeight
+{
+    return 48.;
+}
+
 @end


=====================================
modules/gui/macosx/library/VLCLibraryWindow.h
=====================================
@@ -63,7 +63,7 @@ extern const CGFloat VLCLibraryWindowMinimalHeight;
 extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier;
 
 @property (nonatomic, weak) IBOutlet VLCControlsBarCommon* controlsBar;
-@property (readwrite, weak) IBOutlet NSLayoutConstraint 
*videoViewBottomConstraint;
+@property (readwrite, weak) IBOutlet NSLayoutConstraint 
*controlsBarHeightConstraint;
 @property (readwrite, weak) IBOutlet NSSegmentedControl *segmentedTitleControl;
 @property (readwrite, weak) IBOutlet NSSegmentedControl 
*gridVsListSegmentedControl;
 @property (readwrite, weak) IBOutlet NSSplitView *mainSplitView;
@@ -133,7 +133,6 @@ extern const NSUserInterfaceItemIdentifier 
VLCLibraryWindowIdentifier;
 @property (readwrite, weak) IBOutlet NSToolbarItem *librarySearchToolbarItem;
 @property (readwrite, weak) IBOutlet NSToolbarItem *togglePlaylistToolbarItem;
 @property (readwrite, weak) IBOutlet NSLayoutConstraint 
*splitViewBottomConstraintToBottomBar;
-@property (readwrite, weak) IBOutlet NSLayoutConstraint 
*splitViewBottomConstraintToSuperView;
 
 @property (nonatomic, readwrite, strong) IBOutlet NSView *emptyLibraryView;
 @property (nonatomic, readwrite, strong) IBOutlet NSImageView 
*placeholderImageView;


=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -158,7 +158,7 @@ static void addShadow(NSImageView *__unsafe_unretained 
imageView)
     self.videoViewController.view.frame = self.mainSplitView.frame;
     self.videoViewController.view.hidden = YES;
     self.videoViewController.displayLibraryControls = YES;
-    [self hideControlsBar];
+    [self hideControlsBarImmediately];
 
     [self.gridVsListSegmentedControl setToolTip: _NS("Grid View or List 
View")];
     [self.librarySortButton setToolTip: _NS("Select Sorting Mode")];
@@ -883,21 +883,32 @@ static void addShadow(NSImageView *__unsafe_unretained 
imageView)
     [self enableVideoPlaybackAppearance];
 }
 
+- (void)hideControlsBarImmediately
+{
+    self.controlsBarHeightConstraint.constant = 0;
+}
+
 - (void)hideControlsBar
 {
-    _controlsBar.bottomBarView.hidden = YES;
-    _videoViewBottomConstraint.priority = 1;
-    _splitViewBottomConstraintToBottomBar.priority = 1;
-    _splitViewBottomConstraintToSuperView.priority = 999;
+    [NSAnimationContext runAnimationGroup:^(NSAnimationContext * const 
context) {
+        context.timingFunction = [CAMediaTimingFunction 
functionWithName:kCAMediaTimingFunctionEaseOut];
+        context.duration = VLCLibraryUIUnits.controlsFadeAnimationDuration;
+        self.controlsBarHeightConstraint.animator.constant = 0;
+    } completionHandler:nil];
+}
 
+- (void)showControlsBarImmediately
+{
+    self.controlsBarHeightConstraint.constant = 
VLCLibraryUIUnits.libraryWindowControlsBarHeight;
 }
 
 - (void)showControlsBar
 {
-    _controlsBar.bottomBarView.hidden = NO;
-    _videoViewBottomConstraint.priority = 999;
-    _splitViewBottomConstraintToBottomBar.priority = 999;
-    _splitViewBottomConstraintToSuperView.priority = 1;
+    [NSAnimationContext runAnimationGroup:^(NSAnimationContext * const 
context) {
+        context.timingFunction = [CAMediaTimingFunction 
functionWithName:kCAMediaTimingFunctionEaseIn];
+        context.duration = VLCLibraryUIUnits.controlsFadeAnimationDuration;
+        self.controlsBarHeightConstraint.animator.constant = 
VLCLibraryUIUnits.libraryWindowControlsBarHeight;
+    } completionHandler:nil];
 }
 
 - (void)presentExternalWindows
@@ -979,7 +990,7 @@ static void addShadow(NSImageView *__unsafe_unretained 
imageView)
     [self.backwardsNavigationButton setEnabled:YES];
 
     [self enableVideoTitleBarMode];
-    [self hideControlsBar];
+    [self hideControlsBarImmediately];
     [self.videoViewController showControls];
 }
 
@@ -1004,7 +1015,7 @@ static void addShadow(NSImageView *__unsafe_unretained 
imageView)
     [self setViewForSelectedSegment];
 
     [self disableVideoTitleBarMode];
-    [self showControlsBar];
+    [self showControlsBarImmediately];
 }
 
 - (void)mouseMoved:(NSEvent *)o_event



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/64ac3880b935c2a9720e613cdd77db98bc4e690d...f16e9b0201abbc494f0df1210f3db997067f0a83

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/64ac3880b935c2a9720e613cdd77db98bc4e690d...f16e9b0201abbc494f0df1210f3db997067f0a83
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to