[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx: Add a final height convenience method to collection view flow layout

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Dec 3 10:20:55 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
adb563d3 by Claudio Cambra at 2024-12-03T10:00:18+00:00
macosx: Add a final height convenience method to collection view flow layout

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

- - - - -
a4d39f9c by Claudio Cambra at 2024-12-03T10:00:18+00:00
macosx: Ensure when expanding the supplementary detail view that the view will be visible

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

- - - - -
8752d37d by Claudio Cambra at 2024-12-03T10:00:18+00:00
macosx: Remove unnecessary ifs in scroll to view

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

- - - - -
31bfc11b by Claudio Cambra at 2024-12-03T10:00:18+00:00
macosx: Add spacing to end when scrolling to display supplementary detail view

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
=====================================
@@ -153,6 +153,21 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink,
     return _prevProvidedAnimationStep;
 }
 
+- (CGFloat)finalExpandedHeight
+{
+    switch(_animationType) {
+        case VLCExpandAnimationTypeHorizontalMedium:
+            return VLCLibraryUIUnits.mediumDetailSupplementaryViewCollectionViewWidth;
+        case VLCExpandAnimationTypeHorizontalLarge:
+            return VLCLibraryUIUnits.largeDetailSupplementaryViewCollectionViewWidth;
+        case VLCExpandAnimationTypeVerticalLarge:
+            return VLCLibraryUIUnits.largeDetailSupplementaryViewCollectionViewHeight;
+        case VLCExpandAnimationTypeVerticalMedium:
+        default:
+            return VLCLibraryUIUnits.mediumDetailSupplementaryViewCollectionViewHeight;
+    }
+}
+
 #pragma mark - Public methods
 - (void)expandDetailSectionAtIndex:(NSIndexPath *)indexPath
 {
@@ -172,6 +187,10 @@ static CVReturn detailViewAnimationCallback(CVDisplayLinkRef displayLink,
 
     if (!newItemOnSameRow) {
         [self animateDetailViewWithAnimation:VLCDetailViewAnimationTypeExpand];
+
+        NSRect frame = [self.collectionView layoutAttributesForItemAtIndexPath:indexPath].frame;
+        frame.size.height += [self finalExpandedHeight] + VLCLibraryUIUnits.largeSpacing;
+        [self.collectionView.animator scrollRectToVisible:frame];
     } else {
         _animationIsCollapse = NO;
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a5732065a21f967f5aae1c9b8d3b5eb7bbc201b3...31bfc11b33985296348f62a31fe8324b307e88cd

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a5732065a21f967f5aae1c9b8d3b5eb7bbc201b3...31bfc11b33985296348f62a31fe8324b307e88cd
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