[vlc-commits] [Git][videolan/vlc][master] macosx: use image accessors for audio placeholders
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Mon Jul 20 16:40:14 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
76a78a0b by Serhii Bykov at 2026-07-20T18:04:48+02:00
macosx: use image accessors for audio placeholders
- - - - -
3 changed files:
- modules/gui/macosx/extensions/NSImage+VLCAdditions.h
- modules/gui/macosx/extensions/NSImage+VLCAdditions.m
- modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
Changes:
=====================================
modules/gui/macosx/extensions/NSImage+VLCAdditions.h
=====================================
@@ -49,6 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (class, readonly) NSImage *VLCNoArtImage;
@property (class, readonly) NSImage *VLCPlaceholderVideoImage;
@property (class, readonly) NSImage *VLCPlaceholderGroupImage;
+ at property (class, readonly) NSImage *VLCPlaceholderMusicImage;
@property (class, readonly) NSImage *VLCGenericImage;
// Playback control images
=====================================
modules/gui/macosx/extensions/NSImage+VLCAdditions.m
=====================================
@@ -107,6 +107,11 @@
return [NSImage imageNamed:@"placeholder-group2"];
}
++ (NSImage *)VLCPlaceholderMusicImage
+{
+ return [NSImage imageNamed:@"placeholder-music"];
+}
+
+ (NSImage *)VLCGenericImage
{
return [NSImage imageNamed:@"generic"];
=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
=====================================
@@ -22,6 +22,7 @@
#import "VLCLibraryAudioViewController.h"
+#import "extensions/NSImage+VLCAdditions.h"
#import "extensions/NSString+Helpers.h"
#import "extensions/NSWindow+VLCAdditions.h"
@@ -64,7 +65,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
id<VLCMediaLibraryItemProtocol> _awaitingPresentingLibraryItem;
NSArray<NSLayoutConstraint *> *_internalPlaceholderImageViewSizeConstraints;
- NSArray<NSString *> *_placeholderImageNames;
+ NSArray<NSImage *> *_placeholderImages;
NSArray<NSString *> *_placeholderLabelStrings;
VLCLibraryCollectionViewDelegate *_audioLibraryCollectionViewDelegate;
@@ -256,7 +257,12 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
constant:149.f],
];
- _placeholderImageNames = @[@"placeholder-group2", @"placeholder-music", @"placeholder-music", @"placeholder-music"];
+ _placeholderImages = @[
+ NSImage.VLCPlaceholderGroupImage,
+ NSImage.VLCPlaceholderMusicImage,
+ NSImage.VLCPlaceholderMusicImage,
+ NSImage.VLCPlaceholderMusicImage,
+ ];
_placeholderLabelStrings = @[
_NS("Your music artists will appear here.\nGo to the Browse section to add artists you love."),
_NS("Your music albums will appear here.\nGo to the Browse section to add albums you love."),
@@ -327,7 +333,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
NSAssert(selectedLibrarySegment != VLCAudioLibraryRecentsSegment &&
selectedLibrarySegment != VLCAudioLibraryUnknownSegment,
@"Received invalid audio library segment from audio data source!");
- [self.libraryWindow displayLibraryPlaceholderViewWithImage:[NSImage imageNamed:_placeholderImageNames[selectedLibrarySegment]]
+ [self.libraryWindow displayLibraryPlaceholderViewWithImage:_placeholderImages[selectedLibrarySegment]
usingConstraints:self.placeholderImageViewSizeConstraints
displayingMessage:_placeholderLabelStrings[selectedLibrarySegment]];
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/76a78a0b3132a814d066b54c993a3b5cd6ed9243
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/76a78a0b3132a814d066b54c993a3b5cd6ed9243
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