[vlc-commits] [Git][videolan/vlc][work/recents-carousel-video-library] macosx: Add support for displaying carousel rows to video table views

Claudio Cambra (@claucambra) gitlab at videolan.org
Mon Apr 13 19:29:15 UTC 2026



Claudio Cambra pushed to branch work/recents-carousel-video-library at VideoLAN / VLC


Commits:
f227590c by Claudio Cambra at 2026-04-14T03:29:05+08:00
macosx: Add support for displaying carousel rows to video table views

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

- - - - -


3 changed files:

- modules/gui/macosx/library/VLCLibrarySectionedTableViewDataSource.h
- modules/gui/macosx/library/video-library/VLCLibraryVideoTableViewDelegate.h
- modules/gui/macosx/library/video-library/VLCLibraryVideoTableViewDelegate.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibrarySectionedTableViewDataSource.h
=====================================
@@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
 - (NSString *)titleForRow:(NSInteger)row;
 
 @optional
+- (BOOL)isCarouselRow:(NSInteger)row;
 - (nullable VLCLibraryRepresentedItem *)representedItemForHeaderRow:(NSInteger)row;
 
 @end


=====================================
modules/gui/macosx/library/video-library/VLCLibraryVideoTableViewDelegate.h
=====================================
@@ -24,10 +24,14 @@
 
 #import "library/VLCLibraryTableViewDelegate.h"
 
+ at class VLCLibraryHomeViewVideoCarouselContainerView;
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCLibraryVideoTableViewDelegate : VLCLibraryTableViewDelegate
 
+ at property (readwrite, weak, nullable) VLCLibraryHomeViewVideoCarouselContainerView *recentsCarouselView;
+
 @end
 
 NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/library/video-library/VLCLibraryVideoTableViewDelegate.m
=====================================
@@ -31,6 +31,8 @@
 
 #import "library/audio-library/VLCLibraryAudioGroupTableHeaderView.h"
 
+#import "library/home-library/VLCLibraryHomeViewVideoCarouselContainerView.h"
+
 @interface VLCLibraryVideoHeaderRowView : NSTableRowView
 @end
 
@@ -46,6 +48,13 @@
     return self;
 }
 
+- (BOOL)isCarouselRow:(NSInteger)row
+         inDataSource:(NSObject<VLCLibrarySectionedTableViewDataSource> *)dataSource
+{
+    return [dataSource respondsToSelector:@selector(isCarouselRow:)] &&
+           [dataSource isCarouselRow:row];
+}
+
 #pragma mark - NSTableViewDelegate
 
 - (NSView *)tableView:(NSTableView *)tableView
@@ -59,6 +68,10 @@
     NSObject<VLCLibrarySectionedTableViewDataSource> * const sectionedDataSource =
         (NSObject<VLCLibrarySectionedTableViewDataSource> *)tableView.dataSource;
 
+    if ([self isCarouselRow:row inDataSource:sectionedDataSource]) {
+        return self.recentsCarouselView;
+    }
+
     if ([sectionedDataSource isHeaderRow:row]) {
         VLCLibraryAudioGroupTableHeaderView *headerView =
             (VLCLibraryAudioGroupTableHeaderView *)[tableView makeViewWithIdentifier:VLCLibraryAudioGroupTableHeaderViewIdentifier
@@ -87,6 +100,14 @@
     if ([tableView.dataSource conformsToProtocol:@protocol(VLCLibrarySectionedTableViewDataSource)]) {
         NSObject<VLCLibrarySectionedTableViewDataSource> * const sectionedDataSource =
             (NSObject<VLCLibrarySectionedTableViewDataSource> *)tableView.dataSource;
+
+        if ([self isCarouselRow:row inDataSource:sectionedDataSource]) {
+            if (self.recentsCarouselView != nil) {
+                return self.recentsCarouselView.fittingSize.height;
+            }
+            return 0;
+        }
+
         if ([sectionedDataSource isHeaderRow:row]) {
             return VLCLibraryAudioGroupTableHeaderViewHeight;
         }
@@ -100,6 +121,11 @@
     if ([tableView.dataSource conformsToProtocol:@protocol(VLCLibrarySectionedTableViewDataSource)]) {
         NSObject<VLCLibrarySectionedTableViewDataSource> * const sectionedDataSource =
             (NSObject<VLCLibrarySectionedTableViewDataSource> *)tableView.dataSource;
+
+        if ([self isCarouselRow:row inDataSource:sectionedDataSource]) {
+            return NO;
+        }
+
         return ![sectionedDataSource isHeaderRow:row];
     }
     return YES;
@@ -110,6 +136,11 @@
     if ([tableView.dataSource conformsToProtocol:@protocol(VLCLibrarySectionedTableViewDataSource)]) {
         NSObject<VLCLibrarySectionedTableViewDataSource> * const sectionedDataSource =
             (NSObject<VLCLibrarySectionedTableViewDataSource> *)tableView.dataSource;
+
+        if ([self isCarouselRow:row inDataSource:sectionedDataSource]) {
+            return YES;
+        }
+
         return [sectionedDataSource isHeaderRow:row];
     }
     return NO;
@@ -120,7 +151,9 @@
     if ([tableView.dataSource conformsToProtocol:@protocol(VLCLibrarySectionedTableViewDataSource)]) {
         NSObject<VLCLibrarySectionedTableViewDataSource> * const sectionedDataSource =
             (NSObject<VLCLibrarySectionedTableViewDataSource> *)tableView.dataSource;
-        if ([sectionedDataSource isHeaderRow:row]) {
+
+        if ([self isCarouselRow:row inDataSource:sectionedDataSource] ||
+            [sectionedDataSource isHeaderRow:row]) {
             VLCLibraryVideoHeaderRowView * const rowView = [[VLCLibraryVideoHeaderRowView alloc] init];
             return rowView;
         }



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f227590c7eefe59042bf56c8f3743c15d7aba31f
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list