[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx: Enable icon on custom browse icon

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jan 20 09:28:25 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5d718ec5 by Claudio Cambra at 2025-01-20T08:59:20+00:00
macosx: Enable icon on custom browse icon

We are already using Big Sur type symbols elsewhere

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

- - - - -
6d8c8f23 by Claudio Cambra at 2025-01-20T08:59:20+00:00
macosx: Use folder icon instead of wifi as Browse is local

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

- - - - -
56677f62 by Claudio Cambra at 2025-01-20T08:59:20+00:00
macosx: Fix presentation of the folder icon

Position and colour

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

- - - - -
491a32d7 by Claudio Cambra at 2025-01-20T08:59:20+00:00
macosx: Only apply attributed title style if we are running an old OS

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

- - - - -


1 changed file:

- modules/gui/macosx/views/VLCCustomWindowButton.m


Changes:

=====================================
modules/gui/macosx/views/VLCCustomWindowButton.m
=====================================
@@ -265,7 +265,7 @@
 
 @implementation VLCCustomEmptyLibraryBrowseButton
 
--(void)awakeFromNib
+- (void)awakeFromNib
 {
     self.wantsLayer = YES;
     self.layer.backgroundColor = NSColor.VLCAccentColor.CGColor;
@@ -273,19 +273,6 @@
     
     self.bezelStyle = NSBezelStyleRecessed;
     self.bordered = NO;
-    
-    NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithAttributedString:self.attributedTitle];
-    NSRange const titleRange = NSMakeRange(0, [title length]);
-    
-    // Normal
-    [title addAttribute:NSForegroundColorAttributeName value:[NSColor whiteColor] range:titleRange];
-    [self setAttributedTitle:title];
-    
-    // Highlighted
-    [title removeAttribute:NSForegroundColorAttributeName range:titleRange];
-    [title addAttribute:NSForegroundColorAttributeName value:NSColor.VLClibraryLightTitleColor range:titleRange];
-    
-    [self setAttributedAlternateTitle:title];
         
     if ([self.cell isKindOfClass:[NSButtonCell class]]) {
         NSButtonCell *cell = (NSButtonCell *)self.cell;
@@ -293,13 +280,26 @@
         cell.highlightsBy = NSContentsCellMask;
         cell.imagePosition = NSImageLeft;
     }
-    
-#if 0
-    // FIXME: Add the @"wifi" system symbol for macOS 11
+
     if (@available(macOS 11.0, *)) {
-        [NSImage imageWithSystemSymbolName:@"wifi" accessibilityDescription:nil];
+        self.image = [NSImage imageWithSystemSymbolName:@"folder" accessibilityDescription:nil];
+        self.image.template = YES;
+        self.imageHugsTitle = YES;
+        self.contentTintColor = NSColor.whiteColor;
+    } else {
+        NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithAttributedString:self.attributedTitle];
+        NSRange const titleRange = NSMakeRange(0, [title length]);
+
+        // Normal
+        [title addAttribute:NSForegroundColorAttributeName value:[NSColor whiteColor] range:titleRange];
+        [self setAttributedTitle:title];
+
+        // Highlighted
+        [title removeAttribute:NSForegroundColorAttributeName range:titleRange];
+        [title addAttribute:NSForegroundColorAttributeName value:NSColor.VLClibraryLightTitleColor range:titleRange];
+
+        [self setAttributedAlternateTitle:title];
     }
-#endif
 }
 
 @end



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a727e4a17aee3a52692df5c4b2ee0d01dd7fbf63...491a32d732a35e3cea051118c0a11e291e25e230

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a727e4a17aee3a52692df5c4b2ee0d01dd7fbf63...491a32d732a35e3cea051118c0a11e291e25e230
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