[vlc-commits] [Git][videolan/vlc][master] macosx: Fix scroller insets in library views

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Sat Aug 13 10:06:38 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
aa1a7ee7 by Claudio Cambra at 2022-08-13T09:46:11+00:00
macosx: Fix scroller insets in library views

Signed-off-by: Claudio Cambra <claudio.cambra at gmail.com>

- - - - -


1 changed file:

- modules/gui/macosx/library/VLCLibraryWindow.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -337,12 +337,14 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     [self repeatStateUpdated:nil];
     [self shuffleStateUpdated:nil];
     
-    // Need to account for the audio collection switcher at the top
-    const CGFloat audioScrollViewTopInset = 32.;
     const CGFloat scrollViewTopInset = 16.;
     const CGFloat scrollViewRightInset = 0.;
     const CGFloat scrollViewBottomInset = 16.;
     const CGFloat scrollViewLeftInset = 16.;
+
+    // Need to account for the audio collection switcher at the top
+    const CGFloat audioScrollViewTopInset = scrollViewTopInset + 32.;
+
     const NSEdgeInsets defaultInsets = NSEdgeInsetsMake(scrollViewTopInset,
                                                         scrollViewLeftInset,
                                                         scrollViewBottomInset,
@@ -351,23 +353,35 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
                                                                 scrollViewLeftInset,
                                                                 scrollViewBottomInset,
                                                                 scrollViewRightInset);
+    // We might want to give the content some insets, but this will also affect the scrollbars.
+    // We need to compensate for this or they will look wrong.
+    const NSEdgeInsets scrollerInsets = NSEdgeInsetsMake(-scrollViewTopInset,
+                                                        -scrollViewLeftInset,
+                                                        -scrollViewBottomInset,
+                                                        -scrollViewRightInset);
     
     _audioCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
     _audioCollectionViewScrollView.contentInsets = audioScrollViewInsets;
+    _audioCollectionViewScrollView.scrollerInsets = scrollerInsets;
 
     _audioCollectionSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
     _audioCollectionSelectionTableViewScrollView.contentInsets = audioScrollViewInsets;
+    _audioCollectionSelectionTableViewScrollView.scrollerInsets = scrollerInsets;
     _audioGroupSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
     _audioGroupSelectionTableViewScrollView.contentInsets = audioScrollViewInsets;
+    _audioGroupSelectionTableViewScrollView.scrollerInsets = scrollerInsets;
     
     _videoLibraryScrollView.automaticallyAdjustsContentInsets = NO;
     _videoLibraryScrollView.contentInsets = defaultInsets;
+    _videoLibraryScrollView.scrollerInsets = scrollerInsets;
 
     _mediaSourceCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
     _mediaSourceCollectionViewScrollView.contentInsets = defaultInsets;
+    _mediaSourceCollectionViewScrollView.scrollerInsets = scrollerInsets;
 
     _mediaSourceTableViewScrollView.automaticallyAdjustsContentInsets = NO;
     _mediaSourceTableViewScrollView.contentInsets = defaultInsets;
+    _mediaSourceTableViewScrollView.scrollerInsets = scrollerInsets;
 
     const CGFloat collectionItemSpacing = 20.;
     const NSEdgeInsets collectionViewSectionInset = NSEdgeInsetsMake(20., 20., 20., 20.);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/aa1a7ee75a072fd4b5d7d5b710486e354a291e14

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/aa1a7ee75a072fd4b5d7d5b710486e354a291e14
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