[vlc-commits] macosx: emphasize current playlist item visually

Felix Paul Kühne git at videolan.org
Thu Jan 31 17:58:41 CET 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Thu Jan 31 17:54:50 2019 +0100| [37feeaa99f8aa5a8710c486de80ec1ce483f315c] | committer: Felix Paul Kühne

macosx: emphasize current playlist item visually

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=37feeaa99f8aa5a8710c486de80ec1ce483f315c
---

 modules/gui/macosx/VLCPlaylistDataSource.m    |  2 +-
 modules/gui/macosx/VLCPlaylistTableCellView.h |  1 +
 modules/gui/macosx/VLCPlaylistTableCellView.m | 12 ++++++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCPlaylistDataSource.m b/modules/gui/macosx/VLCPlaylistDataSource.m
index cedb6060ae..bd4401c0b9 100644
--- a/modules/gui/macosx/VLCPlaylistDataSource.m
+++ b/modules/gui/macosx/VLCPlaylistDataSource.m
@@ -79,7 +79,7 @@ static NSString *VLCPlaylistCellIdentifier = @"VLCPlaylistCellIdentifier";
     cellView.mediaTitleTextField.stringValue = item.title;
     cellView.durationTextField.stringValue = [NSString stringWithTimeFromTicks:item.duration];
     cellView.mediaImageView.image = [NSImage imageNamed: @"noart.png"];
-    // TODO: show more data if available
+    cellView.representsCurrentPlaylistItem = _playlistController.currentPlaylistIndex == row;
 
     return cellView;
 }
diff --git a/modules/gui/macosx/VLCPlaylistTableCellView.h b/modules/gui/macosx/VLCPlaylistTableCellView.h
index 50599576c3..2a3b10730c 100644
--- a/modules/gui/macosx/VLCPlaylistTableCellView.h
+++ b/modules/gui/macosx/VLCPlaylistTableCellView.h
@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCPlaylistTableCellView : NSTableCellView
 
+ at property (readwrite, nonatomic) BOOL representsCurrentPlaylistItem;
 @property (readwrite, assign) IBOutlet NSTextField *mediaTitleTextField;
 @property (readwrite, assign) IBOutlet NSTextField *durationTextField;
 @property (readwrite, assign) IBOutlet NSImageView *mediaImageView;
diff --git a/modules/gui/macosx/VLCPlaylistTableCellView.m b/modules/gui/macosx/VLCPlaylistTableCellView.m
index 4eb397047b..bfcbeb515d 100644
--- a/modules/gui/macosx/VLCPlaylistTableCellView.m
+++ b/modules/gui/macosx/VLCPlaylistTableCellView.m
@@ -22,6 +22,18 @@
 
 #import "VLCPlaylistTableCellView.h"
 
+static const float fontSizeForMediaTitle = 13.;
+
 @implementation VLCPlaylistTableCellView
 
+- (void)setRepresentsCurrentPlaylistItem:(BOOL)representsCurrentPlaylistItem
+{
+    _representsCurrentPlaylistItem = representsCurrentPlaylistItem;
+    if (_representsCurrentPlaylistItem) {
+        self.mediaTitleTextField.font = [NSFont boldSystemFontOfSize:fontSizeForMediaTitle];
+    } else {
+        self.mediaTitleTextField.font = [NSFont systemFontOfSize:fontSizeForMediaTitle];
+    }
+}
+
 @end



More information about the vlc-commits mailing list