[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx: Fix content scroll view insets for media source base data source
François Cartegnie (@fcartegnie)
gitlab at videolan.org
Tue Mar 5 18:48:03 UTC 2024
François Cartegnie pushed to branch master at VideoLAN / VLC
Commits:
26308ef3 by Claudio Cambra at 2024-03-05T18:00:57+00:00
macosx: Fix content scroll view insets for media source base data source
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
8a723433 by Claudio Cambra at 2024-03-05T18:00:57+00:00
macosx: Fix base media data source collection view scroller insets
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
8482814e by Claudio Cambra at 2024-03-05T18:00:57+00:00
macosx: Manually set constraint on path control view in media source base data source
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
37ce8ad6 by Claudio Cambra at 2024-03-05T18:00:57+00:00
macosx: Set VLCLibraryWindow XIB constraint for path control view to top of superview as a placeholder
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4 changed files:
- modules/gui/macosx/UI/VLCLibraryWindow.xib
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
- modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
Changes:
=====================================
modules/gui/macosx/UI/VLCLibraryWindow.xib
=====================================
@@ -1231,7 +1231,7 @@
<constraint firstAttribute="bottom" secondItem="cFG-c9-cI9" secondAttribute="bottom" id="DjO-Ru-7sa"/>
<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="LIN-LZ-lhm" firstAttribute="top" secondItem="eHd-Q9-F8D" secondAttribute="top" id="jrw-S8-UBd"/>
+ <constraint firstItem="LIN-LZ-lhm" firstAttribute="top" secondItem="eHd-Q9-F8D" secondAttribute="top" placeholder="YES" 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"/>
=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
=====================================
@@ -30,6 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface VLCLibraryMediaSourceViewController : NSObject
+ at property (readonly) VLCLibraryWindow *libraryWindow;
@property (readonly) NSView *libraryTargetView;
@property (readonly) NSView *mediaSourceView;
@property (readonly) NSTableView *mediaSourceTableView;
@@ -42,6 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly) NSVisualEffectView *pathControlVisualEffectView;
@property (readonly) NSSegmentedControl *gridVsListSegmentedControl;
@property (readonly) NSTextField *placeholderLabel;
+ at property (readonly) NSLayoutConstraint *pathControlViewTopConstraintToSuperview;
@property (readonly) VLCMediaSourceBaseDataSource *baseDataSource;
=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
=====================================
@@ -27,6 +27,7 @@
#import "extensions/NSFont+VLCAdditions.h"
#import "extensions/NSString+Helpers.h"
+#import "extensions/NSWindow+VLCAdditions.h"
#import "library/VLCLibraryCollectionViewFlowLayout.h"
#import "library/VLCLibraryCollectionViewItem.h"
@@ -48,6 +49,7 @@
[self setupCollectionView];
[self setupMediaSourceLibraryViews];
[self setupPlaceholderLabel];
+ [self setupPathControlView];
NSNotificationCenter * const defaultCenter = NSNotificationCenter.defaultCenter;
[defaultCenter addObserver:self
@@ -65,6 +67,7 @@
- (void)setupPropertiesFromLibraryWindow:(VLCLibraryWindow *)libraryWindow
{
NSParameterAssert(libraryWindow);
+ _libraryWindow = libraryWindow;
_libraryTargetView = libraryWindow.libraryTargetView;
_mediaSourceView = libraryWindow.mediaSourceView;
_mediaSourceTableView = libraryWindow.mediaSourceTableView;
@@ -143,6 +146,19 @@
[self updatePlaceholderLabel:nil];
}
+- (void)setupPathControlView
+{
+ _pathControlViewTopConstraintToSuperview = [NSLayoutConstraint constraintWithItem:self.pathControlVisualEffectView
+ attribute:NSLayoutAttributeTop
+ relatedBy:NSLayoutRelationEqual
+ toItem:self.mediaSourceView
+ attribute:NSLayoutAttributeTop
+ multiplier:1.
+ constant:self.libraryWindow.titlebarHeight];
+ [self.mediaSourceView addConstraint:_pathControlViewTopConstraintToSuperview];
+ _pathControlViewTopConstraintToSuperview.active = YES;
+}
+
- (void)updatePlaceholderLabel:(NSNotification *)notification
{
self.placeholderLabel.hidden = self.mediaSourceTableView.numberOfRows > 0;
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
=====================================
@@ -464,10 +464,15 @@ referenceSizeForHeaderInSection:(NSInteger)section
const CGFloat pathControlVisualEffectViewHeight = _pathControlVisualEffectView.frame.size.height;
const CGFloat scrollViewsTopSpace = visible ? pathControlVisualEffectViewHeight + VLCLibraryUIUnits.mediumSpacing : VLCLibraryUIUnits.mediumSpacing;
-
+
NSEdgeInsets collectionViewScrollViewInsets = VLCLibraryUIUnits.libraryViewScrollViewContentInsets;
- collectionViewScrollViewInsets.top = scrollViewsTopSpace;
+ collectionViewScrollViewInsets.top += scrollViewsTopSpace;
+ NSEdgeInsets collectionViewScrollerInsets = VLCLibraryUIUnits.libraryViewScrollViewScrollerInsets;
+ collectionViewScrollerInsets.top += scrollViewsTopSpace;
+
+ _collectionViewScrollView.automaticallyAdjustsContentInsets = NO;
_collectionViewScrollView.contentInsets = collectionViewScrollViewInsets;
+ _collectionViewScrollView.scrollerInsets = collectionViewScrollerInsets;
NSEdgeInsets tableViewScrollViewInsets = VLCLibraryUIUnits.libraryViewScrollViewContentInsets;
tableViewScrollViewInsets.top = scrollViewsTopSpace;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/37dc394c0cbdac4bfda5f15f4c155fb5940835cb...37ce8ad6ec597863464195f37d001334898232be
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/37dc394c0cbdac4bfda5f15f4c155fb5940835cb...37ce8ad6ec597863464195f37d001334898232be
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