[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Add fallback display string for section headers
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun Jul 12 12:34:54 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
80f7ac1a by Claudio Cambra at 2026-07-12T14:22:56+02:00
macosx: Add fallback display string for section headers
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
704d65fa by Claudio Cambra at 2026-07-12T14:22:56+02:00
macosx: Improve fallback string for header view in abstract grouping data sources
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4 changed files:
- modules/gui/macosx/library/VLCLibraryAbstractGroupingDataSource.h
- modules/gui/macosx/library/VLCLibraryAbstractGroupingDataSource.m
- modules/gui/macosx/library/groups-library/VLCLibraryGroupsDataSource.m
- modules/gui/macosx/library/video-library/VLCLibraryShowsDataSource.m
Changes:
=====================================
modules/gui/macosx/library/VLCLibraryAbstractGroupingDataSource.h
=====================================
@@ -39,6 +39,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, weak) NSTableView *detailTableView;
@property (readwrite, weak, nullable) id<VLCLibraryGroupHeaderDelegate> headerDelegate;
+// Required!
+ at property (readonly, nullable) NSString *dataSourceTypeDisplayString;
+
- (void)reloadData;
@end
=====================================
modules/gui/macosx/library/VLCLibraryAbstractGroupingDataSource.m
=====================================
@@ -23,6 +23,7 @@
#import "VLCLibraryAbstractGroupingDataSource.h"
#import "extensions/NSPasteboardItem+VLCAdditions.h"
+#import "extensions/NSString+Helpers.h"
#import "library/VLCLibraryCollectionViewFlowLayout.h"
#import "library/VLCLibraryCollectionViewItem.h"
@@ -175,7 +176,11 @@ viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind
withIdentifier:VLCLibrarySupplementaryElementViewIdentifier
forIndexPath:indexPath];
const id<VLCMediaLibraryItemProtocol> item = self.backingArray[indexPath.section];
- sectionHeadingView.stringValue = item.displayString;
+ NSString *displayString = item.displayString;
+ if (displayString.length == 0) {
+ displayString = [NSString stringWithFormat:@"%@ %@", _NS("Unknown"), self.dataSourceTypeDisplayString];
+ }
+ sectionHeadingView.stringValue = displayString;
return sectionHeadingView;
} else if ([kind isEqualToString:VLCLibraryCollectionViewMediaItemSupplementaryDetailViewKind]) {
=====================================
modules/gui/macosx/library/groups-library/VLCLibraryGroupsDataSource.m
=====================================
@@ -22,6 +22,7 @@
#import "VLCLibraryGroupsDataSource.h"
+#import "extensions/NSString+Helpers.h"
#import "library/VLCLibraryModel.h"
@implementation VLCLibraryGroupsDataSource
@@ -119,4 +120,9 @@
}
}
+- (NSString *)dataSourceTypeDisplayString
+{
+ return _NS("Group");
+}
+
@end
=====================================
modules/gui/macosx/library/video-library/VLCLibraryShowsDataSource.m
=====================================
@@ -22,6 +22,8 @@
#import "VLCLibraryShowsDataSource.h"
+#import "extensions/NSString+Helpers.h"
+
#import "library/VLCLibraryDataTypes.h"
#import "library/VLCLibraryModel.h"
@@ -122,4 +124,9 @@
withAnimation:NSTableViewAnimationEffectFade];
}
+- (NSString *)dataSourceTypeDisplayString
+{
+ return _NS("Show");
+}
+
@end
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/cf184a3e73a658546d7812c76a2e0e473eadd2a3...704d65faa0706761820312ebd7fcb26f9e3b8441
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/cf184a3e73a658546d7812c76a2e0e473eadd2a3...704d65faa0706761820312ebd7fcb26f9e3b8441
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list