Browse Source

macosx: Match positioning and sizing of play queue footer with the main library window playback controls bar

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/192/head
Claudio Cambra 4 months ago
committed by Felix Paul Kühne
parent
commit
9965547b34
  1. 26
      modules/gui/macosx/UI/VLCLibraryWindowPlayQueueView.xib
  2. 2
      modules/gui/macosx/library/VLCLibraryWindowPlayQueueSidebarViewController.h
  3. 24
      modules/gui/macosx/library/VLCLibraryWindowPlayQueueSidebarViewController.m

26
modules/gui/macosx/UI/VLCLibraryWindowPlayQueueView.xib

@ -15,6 +15,8 @@
<outlet property="dragDropView" destination="grx-kk-1X1" id="b1W-Zw-a7Z"/>
<outlet property="footerContainerView" destination="ftr-ct-999" id="ftr-o1-999"/>
<outlet property="footerContainerViewDefaultBottomConstraint" destination="ftr-bot-999" id="y58-xy-3xa"/>
<outlet property="footerContainerViewLeadingConstraint" destination="ftr-lead-999" id="0qS-cp-cxI"/>
<outlet property="footerContainerViewTrailingConstraint" destination="ftr-trail-999" id="BCD-w4-CYV"/>
<outlet property="openMediaButton" destination="ghp-DI-YmZ" id="30J-m7-gLb"/>
<outlet property="repeatButton" destination="9xU-Ba-Hys" id="myS-5X-rgK"/>
<outlet property="scrollView" destination="EIb-Is-vco" id="9JX-Ba-BHj"/>
@ -29,14 +31,14 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView identifier="VLCLibraryWindowPlayQueueSidebarIdentifier" id="NJR-gf-yTs">
<rect key="frame" x="0.0" y="0.0" width="510" height="268"/>
<rect key="frame" x="0.0" y="0.0" width="510" height="261"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<box verticalHuggingPriority="751" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="ik5-L4-VLw">
<rect key="frame" x="20" y="265" width="470" height="5"/>
<rect key="frame" x="20" y="258" width="470" height="5"/>
</box>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="18" horizontalPageScroll="10" verticalLineScroll="18" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EIb-Is-vco">
<rect key="frame" x="0.0" y="57" width="510" height="210"/>
<rect key="frame" x="0.0" y="50" width="510" height="210"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="20t-S6-IYS">
<rect key="frame" x="0.0" y="0.0" width="510" height="210"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@ -102,16 +104,16 @@
</scroller>
</scrollView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="ftr-ct-999">
<rect key="frame" x="0.0" y="0.0" width="510" height="57"/>
<rect key="frame" x="0.0" y="0.0" width="510" height="50"/>
<subviews>
<box verticalHuggingPriority="751" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="ew3-Pn-diG">
<rect key="frame" x="20" y="54" width="470" height="5"/>
<rect key="frame" x="20" y="47" width="470" height="5"/>
</box>
<stackView distribution="equalCentering" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hc5-GJ-yJe">
<rect key="frame" x="20" y="0.0" width="490" height="57"/>
<rect key="frame" x="20" y="0.0" width="490" height="50"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bdZ-N9-Noa">
<rect key="frame" x="0.0" y="17" width="24" height="24"/>
<rect key="frame" x="0.0" y="13" width="24" height="24"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="shuffleOn" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="fpN-XQ-XkJ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@ -125,7 +127,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9xU-Ba-Hys">
<rect key="frame" x="155" y="17" width="24" height="24"/>
<rect key="frame" x="155" y="13" width="24" height="24"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="repeatOff" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="CWu-CE-2fG">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@ -139,7 +141,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="C02-6a-1Uw">
<rect key="frame" x="311" y="17" width="24" height="25"/>
<rect key="frame" x="311" y="13" width="24" height="25"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="line.horizontal.3.decrease" catalog="system" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="Qsi-6S-0bG">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@ -153,7 +155,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aKS-lw-hfk">
<rect key="frame" x="466" y="14" width="24.5" height="32"/>
<rect key="frame" x="466" y="10" width="24.5" height="32"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="trash" catalog="system" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="DEr-Gg-n7Z">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@ -184,7 +186,7 @@
<constraints>
<constraint firstAttribute="bottom" secondItem="hc5-GJ-yJe" secondAttribute="bottom" id="0Wh-UN-tLi"/>
<constraint firstItem="hc5-GJ-yJe" firstAttribute="leading" secondItem="ftr-ct-999" secondAttribute="leading" constant="20" symbolic="YES" id="Saj-PQ-UQL"/>
<constraint firstAttribute="height" constant="57" id="ftr-h-001"/>
<constraint firstAttribute="height" constant="50" id="ftr-h-001"/>
<constraint firstItem="ew3-Pn-diG" firstAttribute="leading" secondItem="ftr-ct-999" secondAttribute="leading" constant="20" id="ftr-l-001"/>
<constraint firstAttribute="trailing" secondItem="ew3-Pn-diG" secondAttribute="trailing" constant="20" id="ftr-t-001"/>
<constraint firstItem="ew3-Pn-diG" firstAttribute="top" secondItem="ftr-ct-999" secondAttribute="top" id="ftr-top-001"/>
@ -193,7 +195,7 @@
</constraints>
</customView>
<customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="grx-kk-1X1" customClass="VLCDragDropView">
<rect key="frame" x="0.0" y="57" width="510" height="210"/>
<rect key="frame" x="0.0" y="50" width="510" height="210"/>
<subviews>
<box boxType="custom" borderType="line" borderWidth="0.0" cornerRadius="10" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="aUB-Ld-N2o">
<rect key="frame" x="188" y="38" width="134" height="134"/>

2
modules/gui/macosx/library/VLCLibraryWindowPlayQueueSidebarViewController.h

@ -48,6 +48,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, weak) IBOutlet NSStackView *buttonStack;
@property (readwrite, weak) IBOutlet NSScrollView *scrollView;
@property (readwrite, weak) IBOutlet NSLayoutConstraint *footerContainerViewDefaultBottomConstraint;
@property (readwrite, weak) IBOutlet NSLayoutConstraint *footerContainerViewLeadingConstraint;
@property (readwrite, weak) IBOutlet NSLayoutConstraint *footerContainerViewTrailingConstraint;
@property (readwrite, weak) IBOutlet NSLayoutConstraint *scrollViewDefaultBottomConstraint;
@property (readwrite, nonatomic) NSTextField *counterLabel;

24
modules/gui/macosx/library/VLCLibraryWindowPlayQueueSidebarViewController.m

@ -96,10 +96,10 @@
- (void)setupBlurredHeaderFooter
{
const CGFloat footerHeight = self.footerContainerView.frame.size.height;
if (@available(macOS 26.0, *)) {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 260000
const CGFloat footerHeight = self.footerContainerView.frame.size.height;
[self.bottomButtonsSeparator removeFromSuperview];
NSGlassEffectView * const glassFooterView = [[NSGlassEffectView alloc] init];
@ -111,20 +111,32 @@
self.footerContainerView.clipsToBounds = NO;
[glassFooterView applyConstraintsToFillSuperview];
self.buttonStack.edgeInsets = NSEdgeInsetsMake(
VLCLibraryUIUnits.mediumSpacing,
VLCLibraryUIUnits.largeSpacing,
VLCLibraryUIUnits.mediumSpacing,
VLCLibraryUIUnits.largeSpacing
);
self.scrollViewDefaultBottomConstraint.active = NO;
self.footerContainerViewDefaultBottomConstraint.active = NO;
self.footerContainerViewLeadingConstraint.constant = VLCLibraryUIUnits.largeSpacing;
self.footerContainerViewTrailingConstraint.constant = VLCLibraryUIUnits.largeSpacing;
NSLayoutConstraint * const footerBottomConstraint =
[self.buttonStack.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor
constant:-VLCLibraryUIUnits.largeSpacing];
[NSLayoutConstraint activateConstraints:@[
[self.scrollView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor],
[self.buttonStack.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-VLCLibraryUIUnits.mediumSpacing]
footerBottomConstraint
]];
const CGFloat footerTopLine = footerHeight + -footerBottomConstraint.constant + VLCLibraryUIUnits.smallSpacing;
self.scrollView.automaticallyAdjustsContentInsets = NO;
self.scrollView.contentInsets = NSEdgeInsetsMake(0, 0, footerHeight, 0);
self.scrollView.contentInsets = NSEdgeInsetsMake(0, 0, footerTopLine, 0);
#endif
} else if (@available(macOS 10.14, *)) {
const CGFloat footerHeight = self.footerContainerView.frame.size.height;
NSVisualEffectView * const footerBlurView = [[NSVisualEffectView alloc] initWithFrame:self.footerContainerView.bounds];
footerBlurView.translatesAutoresizingMaskIntoConstraints = NO;
footerBlurView.material = NSVisualEffectMaterialHeaderView;

Loading…
Cancel
Save