[vlc-commits] [Git][videolan/vlc][master] 13 commits: macosx: Move video view table view row height setting out of VLCLibraryWindow...

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Feb 12 09:56:56 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
22273320 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move video view table view row height setting out of VLCLibraryWindow and into VLCLibraryVideoViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a97f1624 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move audio view table views row height setting out of VLCLibraryWindow and into VLCLibraryAudioViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
469d2350 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move media source view table views row height setting out of VLCLibraryWindow and into VLCLibraryMediaSourceViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
75674f30 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Add library view scroll view content insets method to VLCLibraryUIUnits

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
51d3aeeb by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Add library view scroll view scroller insets method to VLCLibraryUIUnits

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
df3b73b1 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move inset and sizing setup for audio library views from VLCLibraryWindow to VLCLibraryAudioViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
e889818d by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move inset and sizing setup for video library views from VLCLibraryWindow to VLCLibraryVideoViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
0d648490 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move inset and sizing setup for media source library views from VLCLibraryWindow to VLCLibraryMediaSourceViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
9556d138 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Add unified collection view item spacing method to VLCLibraryUIUnits

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
5cc764b8 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Add unified collection view section insets method to VLCLibraryUIUnits

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
0cdb57a4 by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move collection view section inset and item spacing setup views from VLCLibraryWindow to VLCLibraryAudioViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
9995459e by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move video inner collection view section inset and item spacing setup views from VLCLibraryWindow to VLCLibraryVideoViewCollectionViewContainerView

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
c13fcfde by Claudio Cambra at 2023-02-12T09:41:00+00:00
macosx: Move media source collection view section inset and item spacing setup views from VLCLibraryWindow to VLCLibraryMediaSourceViewController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


9 changed files:

- modules/gui/macosx/library/VLCLibraryUIUnits.h
- modules/gui/macosx/library/VLCLibraryUIUnits.m
- modules/gui/macosx/library/VLCLibraryWindow.m
- modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.h
- modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
- modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerView.m
- modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryUIUnits.h
=====================================
@@ -51,10 +51,16 @@ NS_ASSUME_NONNULL_BEGIN
 + (const CGFloat)dynamicCollectionViewItemMinimumWidth;
 + (const CGFloat)dynamicCollectionViewItemMaximumWidth;
 
++ (const CGFloat)collectionViewItemSpacing;
++ (const NSEdgeInsets)collectionViewSectionInsets;
+
 + (const NSSize)adjustedCollectionViewItemSizeForCollectionView:(NSCollectionView *)collectionView
                                                      withLayout:(VLCLibraryCollectionViewFlowLayout *)collectionViewLayout
                                            withItemsAspectRatio:(VLCLibraryCollectionViewItemAspectRatio)itemsAspectRatio;
 
++ (const NSEdgeInsets)libraryViewScrollViewContentInsets;
++ (const NSEdgeInsets)libraryViewScrollViewScrollerInsets;
+
 @end
 
 NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/library/VLCLibraryUIUnits.m
=====================================
@@ -82,6 +82,17 @@
     return 280;
 }
 
++ (const CGFloat)collectionViewItemSpacing
+{
+    return [self largeSpacing];
+}
+
++ (const NSEdgeInsets)collectionViewSectionInsets
+{
+    const CGFloat inset = [self largeSpacing];
+    return NSEdgeInsetsMake(inset, inset, inset, inset);
+}
+
 + (const NSSize)adjustedCollectionViewItemSizeForCollectionView:(NSCollectionView *)collectionView
                                                      withLayout:(VLCLibraryCollectionViewFlowLayout *)collectionViewLayout
                                            withItemsAspectRatio:(VLCLibraryCollectionViewItemAspectRatio)itemsAspectRatio
@@ -137,4 +148,21 @@
     return NSMakeSize(itemWidth, itemHeight);
 }
 
++ (const NSEdgeInsets)libraryViewScrollViewContentInsets
+{
+    return NSEdgeInsetsMake([VLCLibraryUIUnits mediumSpacing],
+                            [VLCLibraryUIUnits mediumSpacing],
+                            [VLCLibraryUIUnits mediumSpacing],
+                            [VLCLibraryUIUnits mediumSpacing]);
+}
+
++ (const NSEdgeInsets)libraryViewScrollViewScrollerInsets
+{
+    const NSEdgeInsets contentInsets = [self libraryViewScrollViewContentInsets];
+    return NSEdgeInsetsMake(-contentInsets.top,
+                            -contentInsets.left,
+                            -contentInsets.bottom,
+                            -contentInsets.right);
+}
+
 @end


=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -229,16 +229,8 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     [_playlistTableView reloadData];
 
     _libraryVideoViewController = [[VLCLibraryVideoViewController alloc] initWithLibraryWindow:self];
-    _videoLibraryGroupsTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
-    _videoLibraryGroupSelectionTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
-
     _libraryAudioViewController = [[VLCLibraryAudioViewController alloc] initWithLibraryWindow:self];
-    _audioCollectionSelectionTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
-    _audioLibraryGridModeSplitViewListTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
-    _audioGroupSelectionTableView.rowHeight = [VLCLibraryAlbumTableCellView defaultHeight];
-
     _libraryMediaSourceViewController = [[VLCLibraryMediaSourceViewController alloc] initWithLibraryWindow:self];
-    _mediaSourceTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
 
     self.upNextLabel.font = [NSFont VLClibrarySectionHeaderFont];
     self.upNextLabel.stringValue = _NS("Playlist");
@@ -254,94 +246,6 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     [self repeatStateUpdated:nil];
     [self shuffleStateUpdated:nil];
 
-    const CGFloat scrollViewTopInset = [VLCLibraryUIUnits mediumSpacing];
-    const CGFloat scrollViewRightInset = [VLCLibraryUIUnits mediumSpacing];
-    const CGFloat scrollViewBottomInset = [VLCLibraryUIUnits mediumSpacing];
-    const CGFloat scrollViewLeftInset = [VLCLibraryUIUnits mediumSpacing];
-
-    // Need to account for the audio collection switcher at the top
-    const CGFloat audioScrollViewTopInset = scrollViewTopInset + _optionBarView.frame.size.height;
-
-    const NSEdgeInsets defaultInsets = NSEdgeInsetsMake(scrollViewTopInset,
-                                                        scrollViewLeftInset,
-                                                        scrollViewBottomInset,
-                                                        scrollViewRightInset);
-    const NSEdgeInsets audioScrollViewInsets = NSEdgeInsetsMake(audioScrollViewTopInset,
-                                                                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;
-
-    _audioLibraryGridModeSplitViewListTableViewScrollView.automaticallyAdjustsContentInsets = NO;
-    _audioLibraryGridModeSplitViewListTableViewScrollView.contentInsets = audioScrollViewInsets;
-    _audioLibraryGridModeSplitViewListTableViewScrollView.scrollerInsets = scrollerInsets;
-    _audioLibraryGridModeSplitViewListSelectionCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
-    _audioLibraryGridModeSplitViewListSelectionCollectionViewScrollView.contentInsets = audioScrollViewInsets;
-    _audioLibraryGridModeSplitViewListSelectionCollectionViewScrollView.scrollerInsets = scrollerInsets;
-
-    _videoLibraryCollectionViewsStackViewScrollView.automaticallyAdjustsContentInsets = NO;
-    _videoLibraryCollectionViewsStackViewScrollView.contentInsets = defaultInsets;
-    _videoLibraryCollectionViewsStackViewScrollView.scrollerInsets = scrollerInsets;
-    
-    _videoLibraryGroupsTableViewScrollView.automaticallyAdjustsContentInsets = NO;
-    _videoLibraryGroupsTableViewScrollView.contentInsets = defaultInsets;
-    _videoLibraryGroupsTableViewScrollView.scrollerInsets = scrollerInsets;
-    _videoLibraryGroupSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
-    _videoLibraryGroupSelectionTableViewScrollView.contentInsets = defaultInsets;
-    _videoLibraryGroupSelectionTableViewScrollView.scrollerInsets = scrollerInsets;
-
-    _mediaSourceCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
-    _mediaSourceCollectionViewScrollView.contentInsets = defaultInsets;
-    _mediaSourceCollectionViewScrollView.scrollerInsets = scrollerInsets;
-
-    _mediaSourceTableViewScrollView.automaticallyAdjustsContentInsets = NO;
-    _mediaSourceTableViewScrollView.contentInsets = defaultInsets;
-    _mediaSourceTableViewScrollView.scrollerInsets = scrollerInsets;
-
-    const CGFloat collectionItemSpacing = [VLCLibraryUIUnits largeSpacing];
-    const NSEdgeInsets collectionViewSectionInset = NSEdgeInsetsMake(collectionItemSpacing,
-                                                                     collectionItemSpacing,
-                                                                     collectionItemSpacing,
-                                                                     collectionItemSpacing);
-
-    NSCollectionViewFlowLayout *audioLibraryCollectionViewLayout = _audioLibraryCollectionView.collectionViewLayout;
-    audioLibraryCollectionViewLayout.minimumLineSpacing = collectionItemSpacing;
-    audioLibraryCollectionViewLayout.minimumInteritemSpacing = collectionItemSpacing;
-    audioLibraryCollectionViewLayout.sectionInset = collectionViewSectionInset;
-
-    NSCollectionViewFlowLayout *audioLibraryGridModeListSelectionCollectionViewLayout = _audioLibraryGridModeSplitViewListSelectionCollectionView.collectionViewLayout;
-    audioLibraryGridModeListSelectionCollectionViewLayout.minimumLineSpacing = collectionItemSpacing;
-    audioLibraryGridModeListSelectionCollectionViewLayout.minimumInteritemSpacing = collectionItemSpacing;
-    audioLibraryGridModeListSelectionCollectionViewLayout.sectionInset = collectionViewSectionInset;
-
-    VLCLibraryVideoCollectionViewsStackViewController *videoLibraryStackViewController = _libraryVideoViewController.libraryVideoCollectionViewsStackViewController;
-    videoLibraryStackViewController.collectionViewItemSize = [VLCLibraryCollectionViewItem defaultVideoItemSize];
-    videoLibraryStackViewController.collectionViewMinimumLineSpacing = collectionItemSpacing;
-    videoLibraryStackViewController.collectionViewMinimumInteritemSpacing = collectionItemSpacing;
-    videoLibraryStackViewController.collectionViewSectionInset = collectionViewSectionInset;
-
-    NSCollectionViewFlowLayout *mediaSourceCollectionViewLayout = _mediaSourceCollectionView.collectionViewLayout;
-    mediaSourceCollectionViewLayout.itemSize = [VLCLibraryCollectionViewItem defaultSize];
-    mediaSourceCollectionViewLayout.minimumLineSpacing = collectionItemSpacing;
-    mediaSourceCollectionViewLayout.minimumInteritemSpacing = collectionItemSpacing;
-    mediaSourceCollectionViewLayout.sectionInset = collectionViewSectionInset;
-
     // HACK: The size of the segmented title buttons is not always correctly calculated
     // especially when the text we are setting differs from what is set in the storyboard.
     // Hiding and showing the toolbar again must trigger something that causes the width


=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.h
=====================================
@@ -53,6 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readonly) NSImageView *placeholderImageView;
 @property (readonly) NSTextField *placeholderLabel;
 @property (readonly) NSView *emptyLibraryView;
+ at property (readonly) NSVisualEffectView *optionBarView;
 
 @property (readonly) VLCLibraryAudioDataSource *audioDataSource;
 @property (readonly) VLCLibraryAudioGroupDataSource *audioGroupDataSource;


=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
=====================================
@@ -31,6 +31,7 @@
 #import "library/VLCLibraryNavigationStack.h"
 #import "library/VLCLibraryWindow.h"
 
+#import "library/audio-library/VLCLibraryAlbumTableCellView.h"
 #import "library/audio-library/VLCLibraryAudioDataSource.h"
 #import "library/audio-library/VLCLibraryAudioGroupDataSource.h"
 
@@ -69,6 +70,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
         [self setupGridModeSplitView];
         [self setupAudioTableViews];
         [self setupAudioSegmentedControl];
+        [self setupAudioLibraryViews];
 
         NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
         [notificationCenter addObserver:self
@@ -108,6 +110,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
     _placeholderImageView = libraryWindow.placeholderImageView;
     _placeholderLabel = libraryWindow.placeholderLabel;
     _emptyLibraryView = libraryWindow.emptyLibraryView;
+    _optionBarView = libraryWindow.optionBarView;
 }
 
 - (void)setupAudioDataSource
@@ -135,7 +138,14 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
     _audioLibraryCollectionView.allowsMultipleSelection = NO;
     _audioLibraryCollectionView.allowsEmptySelection = YES;
 
-    _audioLibraryCollectionView.collectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
+    const CGFloat collectionItemSpacing = [VLCLibraryUIUnits collectionViewItemSpacing];
+    const NSEdgeInsets collectionViewSectionInset = [VLCLibraryUIUnits collectionViewSectionInsets];
+
+    NSCollectionViewFlowLayout *audioLibraryCollectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
+    _audioLibraryCollectionView.collectionViewLayout = audioLibraryCollectionViewLayout;
+    audioLibraryCollectionViewLayout.minimumLineSpacing = collectionItemSpacing;
+    audioLibraryCollectionViewLayout.minimumInteritemSpacing = collectionItemSpacing;
+    audioLibraryCollectionViewLayout.sectionInset = collectionViewSectionInset;
 }
 
 - (void)setupAudioTableViews
@@ -166,7 +176,15 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
     _audioLibraryGridModeSplitViewListSelectionCollectionView.allowsMultipleSelection = NO;
     _audioLibraryGridModeSplitViewListSelectionCollectionView.allowsEmptySelection = YES;
 
-    _audioLibraryGridModeSplitViewListSelectionCollectionView.collectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
+    const CGFloat collectionItemSpacing = [VLCLibraryUIUnits collectionViewItemSpacing];
+    const NSEdgeInsets collectionViewSectionInset = [VLCLibraryUIUnits collectionViewSectionInsets];
+
+    NSCollectionViewFlowLayout *audioLibraryGridModeListSelectionCollectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
+    _audioLibraryGridModeSplitViewListSelectionCollectionView.collectionViewLayout = audioLibraryGridModeListSelectionCollectionViewLayout;
+    audioLibraryGridModeListSelectionCollectionViewLayout.minimumLineSpacing = collectionItemSpacing;
+    audioLibraryGridModeListSelectionCollectionViewLayout.minimumInteritemSpacing = collectionItemSpacing;
+    audioLibraryGridModeListSelectionCollectionViewLayout.sectionInset = collectionViewSectionInset;
+
 }
 
 - (void)setupAudioPlaceholderView
@@ -213,6 +231,39 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
     [_audioSegmentedControl setAction:@selector(segmentedControlAction:)];
 }
 
+- (void)setupAudioLibraryViews
+{
+    _audioCollectionSelectionTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
+    _audioLibraryGridModeSplitViewListTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
+    _audioGroupSelectionTableView.rowHeight = [VLCLibraryAlbumTableCellView defaultHeight];
+
+    const NSEdgeInsets defaultContentInsets = [VLCLibraryUIUnits libraryViewScrollViewContentInsets];
+    const CGFloat topAudioScrollViewContentInset = defaultContentInsets.top + _optionBarView.frame.size.height;
+    const NSEdgeInsets audioScrollViewContentInsets = NSEdgeInsetsMake(topAudioScrollViewContentInset,
+                                                                       defaultContentInsets.left,
+                                                                       defaultContentInsets.bottom,
+                                                                       defaultContentInsets.right);
+    const NSEdgeInsets audioScrollViewScrollerInsets = [VLCLibraryUIUnits libraryViewScrollViewScrollerInsets];
+
+    _audioCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _audioCollectionViewScrollView.contentInsets = audioScrollViewContentInsets;
+    _audioCollectionViewScrollView.scrollerInsets = audioScrollViewScrollerInsets;
+
+    _audioCollectionSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _audioCollectionSelectionTableViewScrollView.contentInsets = audioScrollViewContentInsets;
+    _audioCollectionSelectionTableViewScrollView.scrollerInsets = audioScrollViewScrollerInsets;
+    _audioGroupSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _audioGroupSelectionTableViewScrollView.contentInsets = audioScrollViewContentInsets;
+    _audioGroupSelectionTableViewScrollView.scrollerInsets = audioScrollViewScrollerInsets;
+
+    _audioLibraryGridModeSplitViewListTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _audioLibraryGridModeSplitViewListTableViewScrollView.contentInsets = audioScrollViewContentInsets;
+    _audioLibraryGridModeSplitViewListTableViewScrollView.scrollerInsets = audioScrollViewScrollerInsets;
+    _audioLibraryGridModeSplitViewListSelectionCollectionViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _audioLibraryGridModeSplitViewListSelectionCollectionViewScrollView.contentInsets = audioScrollViewContentInsets;
+    _audioLibraryGridModeSplitViewListSelectionCollectionViewScrollView.scrollerInsets = audioScrollViewScrollerInsets;
+}
+
 #pragma mark - Show the audio view
 
 - (void)presentAudioView


=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
=====================================
@@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (readonly) NSView *libraryTargetView;
 @property (readonly) NSView *mediaSourceView;
+ at property (readonly) NSTableView *mediaSourceTableView;
 @property (readonly) NSCollectionView *collectionView;
 @property (readonly) NSScrollView *collectionViewScrollView;
 @property (readonly) NSTableView *tableView;


=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
=====================================
@@ -25,7 +25,9 @@
 #import "VLCMediaSourceBaseDataSource.h"
 
 #import "library/VLCLibraryCollectionViewFlowLayout.h"
+#import "library/VLCLibraryCollectionViewItem.h"
 #import "library/VLCLibraryController.h"
+#import "library/VLCLibraryUIUnits.h"
 #import "library/VLCLibraryWindow.h"
 
 #import "main/VLCMain.h"
@@ -39,6 +41,7 @@
         [self setupPropertiesFromLibraryWindow:libraryWindow];
         [self setupBaseDataSource];
         [self setupCollectionView];
+        [self setupMediaSourceLibraryViews];
     }
     return self;
 }
@@ -48,6 +51,7 @@
     NSParameterAssert(libraryWindow);
     _libraryTargetView = libraryWindow.libraryTargetView;
     _mediaSourceView = libraryWindow.mediaSourceView;
+    _mediaSourceTableView = libraryWindow.mediaSourceTableView;
     _collectionView = libraryWindow.mediaSourceCollectionView;
     _collectionViewScrollView = libraryWindow.mediaSourceCollectionViewScrollView;
     _tableView = libraryWindow.mediaSourceTableView;
@@ -71,7 +75,31 @@
 
 - (void)setupCollectionView
 {
-    _collectionView.collectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
+    const CGFloat collectionItemSpacing = [VLCLibraryUIUnits collectionViewItemSpacing];
+    const NSEdgeInsets collectionViewSectionInset = [VLCLibraryUIUnits collectionViewSectionInsets];
+    
+    NSCollectionViewFlowLayout *mediaSourceCollectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
+    _collectionView.collectionViewLayout = mediaSourceCollectionViewLayout;
+    mediaSourceCollectionViewLayout.itemSize = [VLCLibraryCollectionViewItem defaultSize];
+    mediaSourceCollectionViewLayout.minimumLineSpacing = collectionItemSpacing;
+    mediaSourceCollectionViewLayout.minimumInteritemSpacing = collectionItemSpacing;
+    mediaSourceCollectionViewLayout.sectionInset = collectionViewSectionInset;
+}
+
+- (void)setupMediaSourceLibraryViews
+{
+    _mediaSourceTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
+
+    const NSEdgeInsets defaultInsets = [VLCLibraryUIUnits libraryViewScrollViewContentInsets];
+    const NSEdgeInsets scrollerInsets = [VLCLibraryUIUnits libraryViewScrollViewScrollerInsets];
+
+    _collectionViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _collectionViewScrollView.contentInsets = defaultInsets;
+    _collectionViewScrollView.scrollerInsets = scrollerInsets;
+
+    _tableViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _tableViewScrollView.contentInsets = defaultInsets;
+    _tableViewScrollView.scrollerInsets = scrollerInsets;
 }
 
 - (void)presentBrowseView


=====================================
modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerView.m
=====================================
@@ -24,6 +24,7 @@
 
 #import "library/VLCLibraryCollectionViewDelegate.h"
 #import "library/VLCLibraryCollectionViewFlowLayout.h"
+#import "library/VLCLibraryCollectionViewItem.h"
 #import "library/VLCLibraryCollectionViewSupplementaryElementView.h"
 #import "library/VLCLibraryUIUnits.h"
 
@@ -102,7 +103,13 @@
 - (void)setupCollectionView
 {
     _collectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
+
+    const CGFloat collectionItemSpacing = [VLCLibraryUIUnits collectionViewItemSpacing];
+    const NSEdgeInsets collectionViewSectionInset = [VLCLibraryUIUnits collectionViewSectionInsets];
     _collectionViewLayout.headerReferenceSize = [VLCLibraryCollectionViewSupplementaryElementView defaultHeaderSize];
+    _collectionViewLayout.minimumLineSpacing = collectionItemSpacing;
+    _collectionViewLayout.minimumInteritemSpacing = collectionItemSpacing;
+    _collectionViewLayout.sectionInset = collectionViewSectionInset;
 
     _collectionView = [[NSCollectionView alloc] initWithFrame:NSZeroRect];
     _collectionView.postsFrameChangedNotifications = YES;
@@ -113,6 +120,7 @@
 
     _collectionViewDelegate = [[VLCLibraryCollectionViewDelegate alloc] init];
     _collectionViewDelegate.itemsAspectRatio = VLCLibraryCollectionViewItemAspectRatioVideoItem;
+    _collectionViewDelegate.staticItemSize = [VLCLibraryCollectionViewItem defaultVideoItemSize];
     _collectionView.delegate = _collectionViewDelegate;
 }
 


=====================================
modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.m
=====================================
@@ -26,6 +26,7 @@
 
 #import "library/VLCLibraryController.h"
 #import "library/VLCLibraryModel.h"
+#import "library/VLCLibraryUIUnits.h"
 #import "library/VLCLibraryWindow.h"
 
 #import "library/audio-library/VLCLibraryAudioViewController.h"
@@ -48,6 +49,7 @@
         [self setupTableViewDataSource];
         [self setupGridViewController];
         [self setupVideoPlaceholderView];
+        [self setupVideoLibraryViews];
 
         NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
         [notificationCenter addObserver:self
@@ -117,6 +119,25 @@
     ];
 }
 
+- (void)setupVideoLibraryViews
+{
+    _videoLibraryGroupsTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
+    _videoLibraryGroupSelectionTableView.rowHeight = [VLCLibraryUIUnits mediumTableViewRowHeight];
+
+    const NSEdgeInsets defaultInsets = [VLCLibraryUIUnits libraryViewScrollViewContentInsets];
+    const NSEdgeInsets scrollerInsets = [VLCLibraryUIUnits libraryViewScrollViewScrollerInsets];
+
+    _videoLibraryCollectionViewsStackViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _videoLibraryCollectionViewsStackViewScrollView.contentInsets = defaultInsets;
+    _videoLibraryCollectionViewsStackViewScrollView.scrollerInsets = scrollerInsets;
+
+    _videoLibraryGroupsTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _videoLibraryGroupsTableViewScrollView.contentInsets = defaultInsets;
+    _videoLibraryGroupsTableViewScrollView.scrollerInsets = scrollerInsets;
+    _videoLibraryGroupSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
+    _videoLibraryGroupSelectionTableViewScrollView.contentInsets = defaultInsets;
+    _videoLibraryGroupSelectionTableViewScrollView.scrollerInsets = scrollerInsets;
+}
 
 #pragma mark - Show the video library view
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0b9fd8e4cbe81eff5d5a3e6ccc8418df1f793030...c13fcfde61f0b026315226e8135143cd92534e01

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0b9fd8e4cbe81eff5d5a3e6ccc8418df1f793030...c13fcfde61f0b026315226e8135143cd92534e01
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