diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.h b/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.h index 6e594ffa95..50143647e6 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.h +++ b/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.h @@ -26,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN @interface VLCLibraryCollectionViewDelegate : NSObject +@property (readwrite, assign) BOOL dynamicItemSizing; + @end NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.m b/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.m index 608b1ecb5c..4d98635912 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.m +++ b/modules/gui/macosx/library/VLCLibraryCollectionViewDelegate.m @@ -28,6 +28,15 @@ @implementation VLCLibraryCollectionViewDelegate +- (instancetype)init +{ + self = [super init]; + if (self) { + _dynamicItemSizing = YES; + } + return self; +} + - (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:(NSSet *)indexPaths { NSIndexPath *indexPath = indexPaths.anyObject; @@ -58,6 +67,10 @@ layout:(NSCollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + if (!_dynamicItemSizing) { + return CGSizeMake(214., 260.); + } + VLCLibraryCollectionViewFlowLayout *collectionViewFlowLayout = (VLCLibraryCollectionViewFlowLayout*)collectionViewLayout; if (collectionViewLayout) { VLCLibraryCollectionViewFlowLayout *collectionViewFlowLayout = (VLCLibraryCollectionViewFlowLayout*)collectionViewLayout;