[vlc-commits] [Git][videolan/vlc][master] 3 commits: macosx: Remove no longer needed manual setting of song table cell view content tint color

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Mar 25 17:46:43 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
17e76315 by Claudio Cambra at 2023-03-25T17:22:12+00:00
macosx: Remove no longer needed manual setting of song table cell view content tint color

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

- - - - -
24f79919 by Claudio Cambra at 2023-03-25T17:22:12+00:00
macosx: Constify identifiers used in VLCLibraryAlbumTableCellView

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

- - - - -
7ad79325 by Claudio Cambra at 2023-03-25T17:22:12+00:00
macosx: Deselect selected rows in child table view of VLCLibraryAlbumTableCellView if the table in a different album table cell view gains focus

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

- - - - -


3 changed files:

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


Changes:

=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.h
=====================================
@@ -32,8 +32,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCLibraryAlbumTableCellView : NSTableCellView<VLCLibraryTableCellViewProtocol>
 
-extern NSString *VLCAudioLibraryCellIdentifier;
-extern NSString *VLCLibraryAlbumTableCellTableViewColumnIdentifier;
+extern NSString * const VLCAudioLibraryCellIdentifier;
+extern NSString * const VLCLibraryAlbumTableCellTableViewColumnIdentifier;
 
 + (instancetype)fromNibWithOwner:(id)owner;
 + (CGFloat)defaultHeight;


=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m
=====================================
@@ -41,8 +41,10 @@
 #import "library/audio-library/VLCLibraryAlbumTracksDataSource.h"
 #import "library/audio-library/VLCLibraryAlbumTracksTableViewDelegate.h"
 
-NSString *VLCAudioLibraryCellIdentifier = @"VLCAudioLibraryCellIdentifier";
-NSString *VLCLibraryAlbumTableCellTableViewColumnIdentifier = @"VLCLibraryAlbumTableCellTableViewColumnIdentifier";
+NSString * const VLCAudioLibraryCellIdentifier = @"VLCAudioLibraryCellIdentifier";
+NSString * const VLCLibraryAlbumTableCellTableViewIdentifier = @"VLCLibraryAlbumTableCellTableViewIdentifier";
+NSString * const VLCLibraryAlbumTableCellTableViewColumnIdentifier = @"VLCLibraryAlbumTableCellTableViewColumnIdentifier";
+
 const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
 
 @interface VLCLibraryAlbumTableCellView ()
@@ -130,6 +132,7 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
 - (void)setupTracksTableView
 {
     _tracksTableView = [[VLCLibraryTableView alloc] initWithFrame:NSZeroRect];
+    _tracksTableView.identifier = VLCLibraryAlbumTableCellTableViewIdentifier;
     _column = [[NSTableColumn alloc] initWithIdentifier:VLCLibraryAlbumTableCellTableViewColumnIdentifier];
     _column.width = [self expectedTableViewWidth];
     _column.maxWidth = MAXFLOAT;
@@ -163,6 +166,12 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
     NSDictionary *dict = NSDictionaryOfVariableBindings(_tracksTableView, _representedImageView, _albumNameTextField, _artistNameTextField);
     [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:horizontalVisualConstraints options:0 metrics:0 views:dict]];
     [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:verticalVisualContraints options:0 metrics:0 views:dict]];
+
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+    [notificationCenter addObserver:self
+                           selector:@selector(handleTableViewSelectionIsChanging:)
+                               name:NSTableViewSelectionIsChangingNotification
+                             object:nil];
 }
 
 - (void)prepareForReuse
@@ -257,4 +266,17 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
     }
 }
 
+- (void)handleTableViewSelectionIsChanging:(NSNotification *)notification
+{
+    NSParameterAssert(notification);
+    NSTableView * const tableView = notification.object;
+    NSAssert(tableView, @"Table view selection changing notification should carry valid table view");
+
+    if (tableView != _tracksTableView &&
+        tableView.identifier == VLCLibraryAlbumTableCellTableViewIdentifier) {
+
+        [_tracksTableView deselectAll:self];
+    }
+}
+
 @end


=====================================
modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m
=====================================
@@ -53,10 +53,6 @@ NSString *VLCAudioLibrarySongCellIdentifier = @"VLCAudioLibrarySongCellIdentifie
 
 - (void)awakeFromNib
 {
-    if(@available(macOS 10.14, *)) {
-        self.playInstantlyButton.contentTintColor = [NSColor VLCAccentColor];
-    }
-
     self.playInstantlyButton.target = self;
     self.playInstantlyButton.action = @selector(playInstantly:);
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3faaa1e109a543e17c0c378a2d7dd2769d695e28...7ad793252ae631e5a2ea410a114313cf0ed1aec1

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