[vlc-commits] [Git][videolan/vlc][master] macosx: use dynamic asset color for library item titles

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Aug 5 07:48:24 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
1ea06348 by Serhii Bykov at 2026-08-05T06:51:06+00:00
macosx: use dynamic asset color for library item titles

- - - - -


4 changed files:

- modules/gui/macosx/extensions/NSColor+VLCAdditions.h
- modules/gui/macosx/extensions/NSColor+VLCAdditions.m
- modules/gui/macosx/library/media-source/VLCMediaSourceDeviceCollectionViewItem.m
- modules/gui/macosx/views/VLCMediaItemCollectionViewItem.m


Changes:

=====================================
modules/gui/macosx/extensions/NSColor+VLCAdditions.h
=====================================
@@ -28,8 +28,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (class, readonly) NSColor *VLCAccentColor;
 @property (class, readonly) NSColor *VLCSubtlerAccentColor;
- at property (class, readonly) NSColor *VLClibraryLightTitleColor;
- at property (class, readonly) NSColor *VLClibraryDarkTitleColor;
 @property (class, readonly) NSColor *VLClibrarySubtitleColor;
 @property (class, readonly) NSColor *VLClibraryAnnotationColor;
 @property (class, readonly) NSColor *VLClibraryAnnotationBackgroundColor;


=====================================
modules/gui/macosx/extensions/NSColor+VLCAdditions.m
=====================================
@@ -43,16 +43,6 @@
     return [NSColor.VLCAccentColor colorWithAlphaComponent:0.8];
 }
 
-+ (NSColor *)VLClibraryLightTitleColor
-{
-    return [NSColor colorWithRed:0.15 green:0.16 blue:0.17 alpha:1.];
-}
-
-+ (NSColor *)VLClibraryDarkTitleColor
-{
-    return [NSColor colorWithRed:0.85 green:0.84 blue:0.83 alpha:1.];
-}
-
 + (NSColor *)VLClibrarySubtitleColor
 {
     return [NSColor colorWithRed:0.52 green:0.57 blue:0.61 alpha:1.];


=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceDeviceCollectionViewItem.m
=====================================
@@ -22,15 +22,8 @@
 
 #import "VLCMediaSourceDeviceCollectionViewItem.h"
 
-#import "extensions/NSColor+VLCAdditions.h"
-#import "extensions/NSFont+VLCAdditions.h"
-
-#import "main/VLCMain.h"
-
 #import "views/VLCImageView.h"
 
-#import <vlc_configuration.h>
-
 NSString *VLCMediaSourceDeviceCellIdentifier = @"VLCMediaSourceDeviceCellIdentifier";
 
 @interface VLCMediaSourceDeviceCollectionViewItem ()


=====================================
modules/gui/macosx/views/VLCMediaItemCollectionViewItem.m
=====================================
@@ -23,7 +23,6 @@
 
 #import "VLCMediaItemCollectionViewItem.h"
 
-#import "extensions/NSAppearance+VLCAdditions.h"
 #import "extensions/NSColor+VLCAdditions.h"
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSString+Helpers.h"
@@ -95,28 +94,9 @@ const CGFloat VLCMediaItemCollectionViewItemMaximumDisplayedProgress = 0.95;
     self.annotationTextField.backgroundColor = NSColor.VLClibraryAnnotationBackgroundColor;
     self.highlightBox.borderColor = NSColor.VLCAccentColor;
     self.unplayedIndicatorTextField.textColor = NSColor.VLCAccentColor;
-
-    [self updateColoredAppearance:self.view.effectiveAppearance];
     [self prepareForReuse];
 }
 
-#pragma mark - dynamic appearance
-
-- (void)viewDidChangeEffectiveAppearance
-{
-    [self updateColoredAppearance:self.view.effectiveAppearance];
-}
-
-- (void)updateColoredAppearance:(NSAppearance *)appearance
-{
-    NSParameterAssert(appearance);
-    const BOOL isDark = appearance.shouldShowDarkAppearance;
-
-    self.mediaTitleTextField.textColor = isDark 
-        ? NSColor.VLClibraryDarkTitleColor
-        : NSColor.VLClibraryLightTitleColor;
-}
-
 #pragma mark - view representation
 
 - (void)prepareForReuse



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1ea06348e728887a501a7b07b6ea89b2068f84be
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