[vlc-commits] [Git][videolan/vlc][master] 9 commits: macosx: Also alter path control top constraint when hiding or showing path controls
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jul 21 12:57:33 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
96dfd43e by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Also alter path control top constraint when hiding or showing path controls
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
1d002096 by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Add constraints to media source views scroll vies to ensure there is no gap to top of superview when path control hidden
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
7233f53f by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Fix path control height during navigation when not hidden
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
3ca8bc26 by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Restructure path control UI to be a visual effect view with children
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
489bb9fd by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Replace old constraint-based handling of hiding path control view bar by just showing/hiding path control view visual effect parent view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
fad1a84c by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Use table view scroll view for hiding/showing in media source views
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
14d87b10 by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Adjust media source views scroll views content insets according to visibility of path control visual effect view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
c6072541 by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Properly adjust insets for the media source views scroll views
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
025084a2 by Claudio Cambra at 2023-07-21T12:17:40+00:00
macosx: Strictly constrain the height of the media source views path control visual effect view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
6 changed files:
- modules/gui/macosx/UI/VLCLibraryWindow.xib
- modules/gui/macosx/library/VLCLibraryWindow.h
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
- modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.h
- modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
Changes:
=====================================
modules/gui/macosx/UI/VLCLibraryWindow.xib
=====================================
@@ -773,12 +773,13 @@
<outlet property="mainSplitView" destination="u8g-jy-S4e" id="lI5-wR-kef"/>
<outlet property="mediaSourceCollectionView" destination="r7v-GI-W1U" id="3JJ-GU-o5o"/>
<outlet property="mediaSourceCollectionViewScrollView" destination="cFG-c9-cI9" id="QQq-Ql-uQ7"/>
+ <outlet property="mediaSourceCollectionViewScrollViewTopConstraint" destination="1h2-ln-GVY" id="orE-bG-zt4"/>
<outlet property="mediaSourceHomeButton" destination="jfA-Vr-sQc" id="oLM-NF-rqe"/>
<outlet property="mediaSourcePathControl" destination="Rjk-Q6-FYy" id="G63-NM-Ekn"/>
- <outlet property="mediaSourcePathControlCollectionViewScrollViewBottomConstraint" destination="Lji-yk-wiI" id="BxP-JG-rlP"/>
- <outlet property="mediaSourcePathControlTableViewScrollViewBottomConstraint" destination="Xao-NR-Utd" id="GYG-ye-2Rq"/>
+ <outlet property="mediaSourcePathControlVisualEffectView" destination="LIN-LZ-lhm" id="gZZ-ov-qfP"/>
<outlet property="mediaSourceTableView" destination="vpJ-Oz-Ebz" id="Hbo-Qw-JQd"/>
<outlet property="mediaSourceTableViewScrollView" destination="7WD-fy-WtJ" id="8As-1W-Af8"/>
+ <outlet property="mediaSourceTableViewScrollViewTopConstraint" destination="y4h-EN-rn0" id="8f7-8Y-Zeb"/>
<outlet property="mediaSourceView" destination="eHd-Q9-F8D" id="gfU-Jp-eFr"/>
<outlet property="mediaToolBar" destination="pr3-TD-J2z" id="Chi-03-Fgd"/>
<outlet property="openMediaButton" destination="SWh-4E-Qtf" id="sIZ-xo-GLA"/>
@@ -1099,38 +1100,52 @@
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
- <pathControl verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Rjk-Q6-FYy" customClass="VLCInputNodePathControl">
- <rect key="frame" x="46" y="381" width="472" height="20"/>
- <pathCell key="cell" controlSize="small" selectable="YES" editable="YES" alignment="left" id="kIb-Jz-eus">
- <font key="font" metaFont="message" size="11"/>
- <url key="url" string="file://localhost/Applications/"/>
- </pathCell>
- </pathControl>
- <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jfA-Vr-sQc">
- <rect key="frame" x="4" y="376" width="38" height="27"/>
+ <visualEffectView blendingMode="withinWindow" material="titlebar" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="LIN-LZ-lhm">
+ <rect key="frame" x="0.0" y="371" width="528" height="40"/>
+ <subviews>
+ <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jfA-Vr-sQc">
+ <rect key="frame" x="4" y="5" width="38" height="27"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="26" id="bRL-Fs-cKa"/>
+ </constraints>
+ <buttonCell key="cell" type="push" bezelStyle="rounded" image="NSHomeTemplate" imagePosition="only" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="OHf-j4-3In">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="message" size="11"/>
+ </buttonCell>
+ </button>
+ <pathControl verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Rjk-Q6-FYy" customClass="VLCInputNodePathControl">
+ <rect key="frame" x="46" y="10" width="200" height="20"/>
+ <pathCell key="cell" controlSize="small" selectable="YES" editable="YES" alignment="left" id="kIb-Jz-eus">
+ <font key="font" metaFont="message" size="11"/>
+ <url key="url" string="file://localhost/Applications/"/>
+ </pathCell>
+ </pathControl>
+ </subviews>
<constraints>
- <constraint firstAttribute="width" constant="26" id="bRL-Fs-cKa"/>
+ <constraint firstAttribute="bottom" secondItem="Rjk-Q6-FYy" secondAttribute="bottom" constant="10" id="3Mz-ox-bKx"/>
+ <constraint firstItem="jfA-Vr-sQc" firstAttribute="centerY" secondItem="Rjk-Q6-FYy" secondAttribute="centerY" id="8oA-Mf-ETE"/>
+ <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="jfA-Vr-sQc" secondAttribute="bottom" constant="10" id="9QR-39-n17"/>
+ <constraint firstAttribute="height" constant="40" id="9YN-h6-4ls"/>
+ <constraint firstItem="jfA-Vr-sQc" firstAttribute="leading" secondItem="LIN-LZ-lhm" secondAttribute="leading" constant="10" id="HIi-nl-quS"/>
+ <constraint firstItem="jfA-Vr-sQc" firstAttribute="top" relation="greaterThanOrEqual" secondItem="LIN-LZ-lhm" secondAttribute="top" constant="10" id="Yux-Fa-4q2"/>
+ <constraint firstItem="Rjk-Q6-FYy" firstAttribute="leading" secondItem="jfA-Vr-sQc" secondAttribute="trailing" constant="10" id="afa-is-HaB"/>
+ <constraint firstItem="Rjk-Q6-FYy" firstAttribute="top" secondItem="LIN-LZ-lhm" secondAttribute="top" constant="10" id="dMk-ci-d2B"/>
+ <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Rjk-Q6-FYy" secondAttribute="trailing" constant="10" id="iDS-9I-EBt"/>
</constraints>
- <buttonCell key="cell" type="push" bezelStyle="rounded" image="NSHomeTemplate" imagePosition="only" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="OHf-j4-3In">
- <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
- <font key="font" metaFont="message" size="11"/>
- </buttonCell>
- </button>
+ </visualEffectView>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="7WD-fy-WtJ" secondAttribute="bottom" id="05c-7d-nw6"/>
- <constraint firstItem="Rjk-Q6-FYy" firstAttribute="leading" secondItem="jfA-Vr-sQc" secondAttribute="trailing" constant="10" id="1OY-9N-uuV"/>
+ <constraint firstItem="cFG-c9-cI9" firstAttribute="top" secondItem="eHd-Q9-F8D" secondAttribute="top" id="1h2-ln-GVY"/>
<constraint firstItem="7WD-fy-WtJ" firstAttribute="leading" secondItem="eHd-Q9-F8D" secondAttribute="leading" id="233-Yb-V4O"/>
<constraint firstAttribute="bottom" secondItem="cFG-c9-cI9" secondAttribute="bottom" id="DjO-Ru-7sa"/>
- <constraint firstItem="cFG-c9-cI9" firstAttribute="top" secondItem="Rjk-Q6-FYy" secondAttribute="bottom" constant="10" id="Lji-yk-wiI"/>
+ <constraint firstAttribute="trailing" secondItem="LIN-LZ-lhm" secondAttribute="trailing" id="N1E-Sc-Vsq"/>
<constraint firstAttribute="trailing" secondItem="7WD-fy-WtJ" secondAttribute="trailing" id="PnR-KD-94A"/>
- <constraint firstItem="Rjk-Q6-FYy" firstAttribute="top" secondItem="eHd-Q9-F8D" secondAttribute="top" constant="10" id="Sf6-jz-ool"/>
- <constraint firstItem="7WD-fy-WtJ" firstAttribute="top" secondItem="Rjk-Q6-FYy" secondAttribute="bottom" constant="10" id="Xao-NR-Utd"/>
- <constraint firstItem="jfA-Vr-sQc" firstAttribute="centerY" secondItem="Rjk-Q6-FYy" secondAttribute="centerY" id="aFD-99-R3a"/>
- <constraint firstAttribute="trailing" secondItem="Rjk-Q6-FYy" secondAttribute="trailing" constant="10" id="c3j-mQ-afF"/>
- <constraint firstItem="jfA-Vr-sQc" firstAttribute="leading" secondItem="eHd-Q9-F8D" secondAttribute="leading" constant="10" id="saP-eI-VDF"/>
+ <constraint firstItem="LIN-LZ-lhm" firstAttribute="top" secondItem="eHd-Q9-F8D" secondAttribute="top" id="jrw-S8-UBd"/>
+ <constraint firstItem="LIN-LZ-lhm" firstAttribute="leading" secondItem="eHd-Q9-F8D" secondAttribute="leading" id="lO4-XK-Pts"/>
<constraint firstAttribute="trailing" secondItem="cFG-c9-cI9" secondAttribute="trailing" id="vkQ-o0-jz4"/>
<constraint firstItem="cFG-c9-cI9" firstAttribute="leading" secondItem="eHd-Q9-F8D" secondAttribute="leading" id="vq6-rW-p6Q"/>
+ <constraint firstItem="7WD-fy-WtJ" firstAttribute="top" secondItem="eHd-Q9-F8D" secondAttribute="top" id="y4h-EN-rn0"/>
</constraints>
<point key="canvasLocation" x="144" y="197.5"/>
</customView>
=====================================
modules/gui/macosx/library/VLCLibraryWindow.h
=====================================
@@ -93,8 +93,7 @@ extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier;
@property (readwrite, weak) IBOutlet NSView *mediaSourceView;
@property (readwrite, weak) IBOutlet NSButton *mediaSourceHomeButton;
@property (readwrite, weak) IBOutlet VLCInputNodePathControl *mediaSourcePathControl;
- at property (readwrite, weak) IBOutlet NSLayoutConstraint *mediaSourcePathControlTableViewScrollViewBottomConstraint;
- at property (readwrite, weak) IBOutlet NSLayoutConstraint *mediaSourcePathControlCollectionViewScrollViewBottomConstraint;
+ at property (readwrite, weak) IBOutlet NSVisualEffectView *mediaSourcePathControlVisualEffectView;
@property (readwrite, weak) IBOutlet NSScrollView *mediaSourceTableViewScrollView;
@property (readwrite, weak) IBOutlet NSTableView *mediaSourceTableView;
@property (readwrite, weak) IBOutlet NSScrollView *mediaSourceCollectionViewScrollView;
=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
=====================================
@@ -39,8 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly) NSScrollView *tableViewScrollView;
@property (readonly) NSButton *homeButton;
@property (readonly) VLCInputNodePathControl *pathControl;
- at property (readonly) NSLayoutConstraint *pathControlBottomTableViewScrollViewConstraint;
- at property (readonly) NSLayoutConstraint *pathControlBottomCollectionViewScrollViewConstraint;
+ at property (readonly) NSVisualEffectView *pathControlVisualEffectView;
@property (readonly) NSSegmentedControl *gridVsListSegmentedControl;
@property (readonly) VLCMediaSourceBaseDataSource *baseDataSource;
=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
=====================================
@@ -58,8 +58,7 @@
_tableViewScrollView = libraryWindow.mediaSourceTableViewScrollView;
_homeButton = libraryWindow.mediaSourceHomeButton;
_pathControl = libraryWindow.mediaSourcePathControl;
- _pathControlBottomTableViewScrollViewConstraint = libraryWindow.mediaSourcePathControlTableViewScrollViewBottomConstraint;
- _pathControlBottomCollectionViewScrollViewConstraint = libraryWindow.mediaSourcePathControlCollectionViewScrollViewBottomConstraint;
+ _pathControlVisualEffectView = libraryWindow.mediaSourcePathControlVisualEffectView;
_gridVsListSegmentedControl = libraryWindow.gridVsListSegmentedControl;
}
@@ -70,9 +69,9 @@
_baseDataSource.collectionViewScrollView = _collectionViewScrollView;
_baseDataSource.homeButton = _homeButton;
_baseDataSource.pathControl = _pathControl;
- _baseDataSource.pathControlBottomTableViewScrollViewConstraint = _pathControlBottomTableViewScrollViewConstraint;
- _baseDataSource.pathControlBottomCollectionViewScrollViewConstraint = _pathControlBottomCollectionViewScrollViewConstraint;
+ _baseDataSource.pathControlVisualEffectView = _pathControlVisualEffectView;
_baseDataSource.tableView = _tableView;
+ _baseDataSource.tableViewScrollView = _tableViewScrollView;
[_baseDataSource setupViews];
}
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.h
=====================================
@@ -41,10 +41,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite) NSCollectionView *collectionView;
@property (readwrite) NSScrollView *collectionViewScrollView;
@property (readwrite) NSTableView *tableView;
+ at property (readwrite) NSScrollView *tableViewScrollView;
@property (readwrite) NSButton *homeButton;
@property (readwrite) VLCInputNodePathControl *pathControl;
- at property (readwrite) NSLayoutConstraint *pathControlBottomTableViewScrollViewConstraint;
- at property (readwrite) NSLayoutConstraint *pathControlBottomCollectionViewScrollViewConstraint;
+ at property (readwrite) NSVisualEffectView *pathControlVisualEffectView;
@property (readwrite, nonatomic) VLCMediaSourceMode mediaSourceMode;
@property (readwrite, nonatomic) VLCMediaSourceDataSource *childDataSource;
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
=====================================
@@ -133,11 +133,11 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
if (viewModeSegment == VLCLibraryGridViewModeSegment) {
self.collectionViewScrollView.hidden = NO;
- self.tableView.hidden = YES;
+ self.tableViewScrollView.hidden = YES;
[self.collectionView reloadData];
} else if (viewModeSegment == VLCLibraryListViewModeSegment) {
self.collectionViewScrollView.hidden = YES;
- self.tableView.hidden = NO;
+ self.tableViewScrollView.hidden = NO;
[self.tableView reloadData];
} else {
NSAssert(false, @"View mode must be grid or list mode");
@@ -469,10 +469,18 @@ referenceSizeForHeaderInSection:(NSInteger)section
- (void)togglePathControlVisibility:(BOOL)visible
{
- _homeButton.hidden = !visible;
- _pathControl.hidden = !visible;
- _pathControlBottomTableViewScrollViewConstraint.constant = visible ? VLCLibraryUIUnits.mediumSpacing : 0;
- _pathControlBottomCollectionViewScrollViewConstraint.constant = visible ? VLCLibraryUIUnits.mediumSpacing : 0;
+ _pathControlVisualEffectView.hidden = !visible;
+
+ const CGFloat pathControlVisualEffectViewHeight = _pathControlVisualEffectView.frame.size.height;
+ const CGFloat scrollViewsTopSpace = visible ? pathControlVisualEffectViewHeight + VLCLibraryUIUnits.mediumSpacing : VLCLibraryUIUnits.mediumSpacing;
+
+ NSEdgeInsets collectionViewScrollViewInsets = VLCLibraryUIUnits.libraryViewScrollViewContentInsets;
+ collectionViewScrollViewInsets.top = scrollViewsTopSpace;
+ _collectionViewScrollView.contentInsets = collectionViewScrollViewInsets;
+
+ NSEdgeInsets tableViewScrollViewInsets = VLCLibraryUIUnits.libraryViewScrollViewContentInsets;
+ tableViewScrollViewInsets.top = scrollViewsTopSpace;
+ _tableViewScrollView.contentInsets = tableViewScrollViewInsets;
}
- (void)returnHome
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2d12f80db5271cf91e0ee69ae1f9669668c48ba7...025084a233bbab83a43574f699f1610656e99a4e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2d12f80db5271cf91e0ee69ae1f9669668c48ba7...025084a233bbab83a43574f699f1610656e99a4e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list