[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx: Fix supplementary detail view in video library view

François Cartegnie (@fcartegnie) gitlab at videolan.org
Sat Mar 2 09:41:27 UTC 2024



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
ccda20b0 by Claudio Cambra at 2024-03-02T09:07:42+00:00
macosx: Fix supplementary detail view in video library view

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

- - - - -
77807da6 by Claudio Cambra at 2024-03-02T09:07:42+00:00
macosx: Only access dataSource once in collection view flow layout attributes method

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

- - - - -
897e8001 by Claudio Cambra at 2024-03-02T09:07:42+00:00
macosx: Simplify conditional for video supplementary detail views

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

- - - - -
ab6eb974 by Claudio Cambra at 2024-03-02T09:07:42+00:00
macosx: Improve style of VLCLibraryCollectionViewFlowLayout layoutAttributesForElementsInRect

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

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewFlowLayout.m
=====================================
@@ -32,6 +32,8 @@
 
 #import "library/home-library/VLCLibraryHomeViewVideoContainerViewDataSource.h"
 
+#import "library/video-library/VLCLibraryVideoDataSource.h"
+
 #pragma mark - Private data
 static const NSUInteger kAnimationSteps = 32;
 static const NSUInteger kWrapAroundValue = (NSUInteger)-1;
@@ -245,9 +247,10 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink,
         layoutAttributesArray[i] = attributes;
     }
 
-    if ([self.collectionView.dataSource isKindOfClass:[VLCLibraryAudioDataSource class]]) {
-        VLCLibraryAudioDataSource *audioDataSource = (VLCLibraryAudioDataSource *)self.collectionView.dataSource;
+    const id<NSCollectionViewDataSource> dataSource = self.collectionView.dataSource;
 
+    if ([dataSource isKindOfClass:VLCLibraryAudioDataSource.class]) {
+        VLCLibraryAudioDataSource * const audioDataSource = (VLCLibraryAudioDataSource *)dataSource;
         // Add detail view to the attributes set -- detail view about to be shown
         switch(audioDataSource.audioLibrarySegment) {
             case VLCAudioLibraryArtistsSegment:
@@ -262,12 +265,10 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink,
                 [layoutAttributesArray addObject:[self layoutAttributesForSupplementaryViewOfKind:VLCLibraryCollectionViewMediaItemSupplementaryDetailViewKind atIndexPath:self.selectedIndexPath]];
                 break;
         }
-
-    } else if ([self.collectionView.dataSource isKindOfClass:[VLCLibraryAudioGroupDataSource class]]) {
+    } else if ([dataSource isKindOfClass:VLCLibraryAudioGroupDataSource.class]) {
         [layoutAttributesArray addObject:[self layoutAttributesForSupplementaryViewOfKind:VLCLibraryCollectionViewAlbumSupplementaryDetailViewKind atIndexPath:self.selectedIndexPath]];
-        
-    } else if ([self.collectionView.dataSource isKindOfClass:[VLCLibraryHomeViewVideoContainerViewDataSource class]]) {
-        VLCLibraryHomeViewVideoContainerViewDataSource *videoDataSource = (VLCLibraryHomeViewVideoContainerViewDataSource *)self.collectionView.dataSource;
+    } else if ([dataSource isKindOfClass:VLCLibraryHomeViewVideoContainerViewDataSource.class] ||
+               [dataSource isKindOfClass:VLCLibraryVideoDataSource.class]) {
         [layoutAttributesArray addObject:[self layoutAttributesForSupplementaryViewOfKind:VLCLibraryCollectionViewMediaItemSupplementaryDetailViewKind atIndexPath:self.selectedIndexPath]];
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3657a5376af18422b7fac018de947efda2e0edd7...ab6eb9749e85d5d692fc7f40b6d964f3bb3f50f9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3657a5376af18422b7fac018de947efda2e0edd7...ab6eb9749e85d5d692fc7f40b6d964f3bb3f50f9
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