[vlc-commits] [Git][videolan/vlc][master] macosx: Fix scroll view insets for table views
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sat Aug 6 18:29:32 UTC 2022
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
4dd70561 by Claudio Cambra at 2022-08-06T18:13:52+00:00
macosx: Fix scroll view insets for table views
Signed-off-by: Claudio Cambra <claudio.cambra at gmail.com>
- - - - -
3 changed files:
- modules/gui/macosx/UI/VLCLibraryWindow.xib
- modules/gui/macosx/library/VLCLibraryWindow.h
- modules/gui/macosx/library/VLCLibraryWindow.m
Changes:
=====================================
modules/gui/macosx/UI/VLCLibraryWindow.xib
=====================================
@@ -663,8 +663,10 @@
</toolbar>
<connections>
<outlet property="audioCollectionSelectionTableView" destination="LNt-ot-2wU" id="aim-ER-CpD"/>
+ <outlet property="audioCollectionSelectionTableViewScrollView" destination="HrP-Dz-Uh0" id="Sh0-oP-3Ad"/>
<outlet property="audioCollectionViewScrollView" destination="AYf-gS-P66" id="Jmt-vH-Vgq"/>
<outlet property="audioGroupSelectionTableView" destination="4ll-T2-J16" id="m18-cT-5BQ"/>
+ <outlet property="audioGroupSelectionTableViewScrollView" destination="Jmx-bp-HDp" id="m81-p1-e5Q"/>
<outlet property="audioLibraryCollectionView" destination="QAt-jP-zE7" id="Lda-FY-5gD"/>
<outlet property="audioLibrarySplitView" destination="llh-BF-BEJ" id="gvt-K1-cGw"/>
<outlet property="audioLibraryView" destination="lpg-UW-pTq" id="FYD-PV-Ce2"/>
@@ -687,6 +689,7 @@
<outlet property="mediaSourceHomeButton" destination="jfA-Vr-sQc" id="oLM-NF-rqe"/>
<outlet property="mediaSourcePathControl" destination="Rjk-Q6-FYy" id="G63-NM-Ekn"/>
<outlet property="mediaSourceTableView" destination="vpJ-Oz-Ebz" id="Hbo-Qw-JQd"/>
+ <outlet property="mediaSourceTableViewScrollView" destination="7WD-fy-WtJ" id="8As-1W-Af8"/>
<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"/>
=====================================
modules/gui/macosx/library/VLCLibraryWindow.h
=====================================
@@ -56,7 +56,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, weak) IBOutlet NSCollectionView *mediaSourceCollectionView;
@property (readwrite, weak) IBOutlet NSView *audioLibraryView;
@property (readwrite, weak) IBOutlet NSSplitView *audioLibrarySplitView;
+ at property (readwrite, weak) IBOutlet NSScrollView *audioCollectionSelectionTableViewScrollView;
@property (readwrite, weak) IBOutlet NSTableView *audioCollectionSelectionTableView;
+ at property (readwrite, weak) IBOutlet NSScrollView *audioGroupSelectionTableViewScrollView;
@property (readwrite, weak) IBOutlet NSTableView *audioGroupSelectionTableView;
@property (readwrite, weak) IBOutlet NSScrollView *audioCollectionViewScrollView;
@property (readwrite, weak) IBOutlet NSCollectionView *audioLibraryCollectionView;
@@ -65,6 +67,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, weak) IBOutlet NSView *mediaSourceView;
@property (readwrite, weak) IBOutlet NSButton *mediaSourceHomeButton;
@property (readwrite, weak) IBOutlet NSPathControl *mediaSourcePathControl;
+ at property (readwrite, weak) IBOutlet NSScrollView *mediaSourceTableViewScrollView;
@property (readwrite, weak) IBOutlet NSTableView *mediaSourceTableView;
@property (readwrite, weak) IBOutlet NSScrollView *mediaSourceCollectionViewScrollView;
@property (readwrite, weak) IBOutlet NSView *libraryTargetView;
=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -333,7 +333,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
[self shuffleStateUpdated:nil];
// Need to account for the audio collection switcher at the top
- const CGFloat audioCollectionScrollViewTopInset = 32.;
+ const CGFloat audioScrollViewTopInset = 32.;
const CGFloat scrollViewTopInset = 16.;
const CGFloat scrollViewRightInset = 0.;
const CGFloat scrollViewBottomInset = 16.;
@@ -342,12 +342,18 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
scrollViewLeftInset,
scrollViewBottomInset,
scrollViewRightInset);
+ const NSEdgeInsets audioScrollViewInsets = NSEdgeInsetsMake(audioScrollViewTopInset,
+ scrollViewLeftInset,
+ scrollViewBottomInset,
+ scrollViewRightInset);
_audioCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
- _audioCollectionViewScrollView.contentInsets = NSEdgeInsetsMake(audioCollectionScrollViewTopInset,
- scrollViewLeftInset,
- scrollViewBottomInset,
- scrollViewRightInset);
+ _audioCollectionViewScrollView.contentInsets = audioScrollViewInsets;
+
+ _audioCollectionSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+ _audioCollectionSelectionTableViewScrollView.contentInsets = audioScrollViewInsets;
+ _audioGroupSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+ _audioGroupSelectionTableViewScrollView.contentInsets = audioScrollViewInsets;
_videoLibraryScrollView.automaticallyAdjustsContentInsets = NO;
_videoLibraryScrollView.contentInsets = defaultInsets;
@@ -355,6 +361,9 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
_mediaSourceCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
_mediaSourceCollectionViewScrollView.contentInsets = defaultInsets;
+ _mediaSourceTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+ _mediaSourceTableViewScrollView.contentInsets = defaultInsets;
+
const CGFloat collectionItemSpacing = 20.;
const NSEdgeInsets collectionViewSectionInset = NSEdgeInsetsMake(20., 20., 20., 20.);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4dd70561dee6f37b99e8b305d75e2cb1a03874e1
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4dd70561dee6f37b99e8b305d75e2cb1a03874e1
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