[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Bold song title of song table cell view when it is the currently playing song

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Dec 15 11:17:46 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
09454e71 by Claudio Cambra at 2024-12-15T11:05:07+00:00
macosx: Bold song title of song table cell view when it is the currently playing song

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

- - - - -
3ed06f0c by Claudio Cambra at 2024-12-15T11:05:07+00:00
macosx: Apply bolding to all text fields in song table cell view

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

- - - - -


1 changed file:

- modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m


Changes:

=====================================
modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m
=====================================
@@ -34,10 +34,14 @@
 
 #import "library/VLCLibraryController.h"
 #import "library/VLCLibraryDataTypes.h"
+#import "library/VLCInputItem.h"
 #import "library/VLCLibraryItemInternalMediaItemsDataSource.h"
 #import "library/VLCLibraryTableCellView.h"
 #import "library/VLCLibraryRepresentedItem.h"
 
+#import "playqueue/VLCPlayerController.h"
+#import "playqueue/VLCPlayQueueController.h"
+
 NSString *VLCAudioLibrarySongCellIdentifier = @"VLCAudioLibrarySongCellIdentifier";
 
 @interface VLCLibrarySongTableCellView ()
@@ -67,9 +71,31 @@ NSString *VLCAudioLibrarySongCellIdentifier = @"VLCAudioLibrarySongCellIdentifie
         self.playInstantlyButton.contentTintColor = NSColor.VLCAccentColor;
     }
 
+    NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter;
+    [notificationCenter addObserver:self
+                           selector:@selector(playStateOrItemChanged:)
+                               name:VLCPlayerCurrentMediaItemChanged
+                             object:nil];
+    [notificationCenter addObserver:self
+                           selector:@selector(playStateOrItemChanged:)
+                               name:VLCPlayerStateChanged
+                             object:nil];
+
     [self prepareForReuse];
 }
 
+- (void)playStateOrItemChanged:(NSNotification *)notification
+{
+    const BOOL isCurrentItemAndIsPlaying =
+        [self.representedItem.item.firstMediaItem.inputItem.MRL isEqualToString:VLCMain.sharedInstance.playQueueController.currentlyPlayingInputItem.MRL];
+    NSFont * const fontToUse = isCurrentItemAndIsPlaying
+        ? [NSFont boldSystemFontOfSize:NSFont.systemFontSize]
+        : [NSFont systemFontOfSize:NSFont.systemFontSize];
+    self.songNameTextField.font = fontToUse;
+    self.durationTextField.font = fontToUse;
+    self.trackNumberTextField.font = fontToUse;
+}
+
 - (void)prepareForReuse
 {
     [super prepareForReuse];



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/988b7bb2ebe3612ee38c1179c60b739ed15ef823...3ed06f0c6ad167df23169233841651169469e675

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/988b7bb2ebe3612ee38c1179c60b739ed15ef823...3ed06f0c6ad167df23169233841651169469e675
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