mirror of
https://github.com/videolan/vlc.git
synced 2024-11-23 18:03:48 +08:00
macosx: iterate on playlist cell view
This introduces an indicator for media where we can be sure it is audio and privatices the cell content setting
This commit is contained in:
parent
5738d7a0b6
commit
7d9948f3a8
@ -500,6 +500,8 @@
|
||||
7D713D302201AE350042BEB7 /* VLCLibraryWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryWindow.h; sourceTree = "<group>"; };
|
||||
7D713D312201AE350042BEB7 /* VLCLibraryWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryWindow.m; sourceTree = "<group>"; };
|
||||
7D713D332201BB130042BEB7 /* VLCLibraryWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryWindow.xib; sourceTree = "<group>"; };
|
||||
7D71B88C229EF61200D919E7 /* note.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = note.png; path = librarywindow/note.png; sourceTree = "<group>"; };
|
||||
7D71B88D229EF61300D919E7 /* note@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "note@2x.png"; path = "librarywindow/note@2x.png"; sourceTree = "<group>"; };
|
||||
7D871D371B5E6844000B56C0 /* VLCMain+OldPrefs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VLCMain+OldPrefs.h"; sourceTree = "<group>"; };
|
||||
7D871D381B5E6844000B56C0 /* VLCMain+OldPrefs.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "VLCMain+OldPrefs.m"; sourceTree = "<group>"; };
|
||||
7D8BB0B318302AC000FAE9B7 /* VLCLogWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLogWindowController.h; sourceTree = "<group>"; };
|
||||
@ -1353,6 +1355,8 @@
|
||||
7D28E63E2275C8660098D30E /* ellipsis@2x.png */,
|
||||
7D28E6402275C9C70098D30E /* libraryPlay.png */,
|
||||
7D28E63F2275C9C70098D30E /* libraryPlay@2x.png */,
|
||||
7D71B88C229EF61200D919E7 /* note.png */,
|
||||
7D71B88D229EF61300D919E7 /* note@2x.png */,
|
||||
7D28E6462275F2850098D30E /* repeatOff.png */,
|
||||
7D28E6442275F2840098D30E /* repeatOff@2x.png */,
|
||||
7D28E6482275F2850098D30E /* repeatOne.png */,
|
||||
|
@ -319,6 +319,8 @@ libmacosx_plugin_la_RES = \
|
||||
gui/macosx/Resources/File-Icons/wmv.icns \
|
||||
gui/macosx/Resources/librarywindow/ellipsis.png \
|
||||
gui/macosx/Resources/librarywindow/ellipsis@2x.png \
|
||||
gui/macosx/Resources/librarywindow/note.png \
|
||||
gui/macosx/Resources/librarywindow/note@2x.png \
|
||||
gui/macosx/Resources/librarywindow/libraryPlay.png \
|
||||
gui/macosx/Resources/librarywindow/libraryPlay@2x.png \
|
||||
gui/macosx/Resources/librarywindow/repeatAll.png \
|
||||
|
BIN
modules/gui/macosx/Resources/librarywindow/note.png
Normal file
BIN
modules/gui/macosx/Resources/librarywindow/note.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 267 B |
BIN
modules/gui/macosx/Resources/librarywindow/note@2x.png
Normal file
BIN
modules/gui/macosx/Resources/librarywindow/note@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 400 B |
@ -9,11 +9,11 @@
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="c22-O7-iKe" customClass="VLCPlaylistTableCellView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="398" height="71"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="398" height="81"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ohB-P0-nCv">
|
||||
<rect key="frame" x="112" y="27" width="37" height="17"/>
|
||||
<rect key="frame" x="131" y="32" width="37" height="17"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="ZPw-XO-XD1">
|
||||
<font key="font" usesAppearanceFont="YES"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -21,7 +21,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xJW-ps-ycn">
|
||||
<rect key="frame" x="112" y="41" width="37" height="17"/>
|
||||
<rect key="frame" x="131" y="46" width="37" height="17"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="aCe-ia-0Ww">
|
||||
<font key="font" usesAppearanceFont="YES"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -29,13 +29,23 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Ydb-7n-5Cd" customClass="VLCImageView">
|
||||
<rect key="frame" x="0.0" y="3" width="104" height="65"/>
|
||||
<rect key="frame" x="3" y="3" width="120" height="75"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="Ydb-7n-5Cd" secondAttribute="height" multiplier="16:10" id="4aB-rs-m22"/>
|
||||
</constraints>
|
||||
</customView>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="xnT-RR-pOf">
|
||||
<rect key="frame" x="3" y="28" width="24" height="24"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="note" id="UzG-df-K2K"/>
|
||||
</imageView>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="97z-d7-S3D" customClass="VLCImageView">
|
||||
<rect key="frame" x="48" y="3" width="75" height="75"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="97z-d7-S3D" secondAttribute="height" multiplier="1:1" id="YBL-j9-anm"/>
|
||||
</constraints>
|
||||
</customView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3Ha-ZH-fa9">
|
||||
<rect key="frame" x="349" y="27" width="37" height="17"/>
|
||||
<rect key="frame" x="349" y="32" width="37" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="33" id="0cB-ga-0Uw"/>
|
||||
</constraints>
|
||||
@ -46,7 +56,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TPv-k2-6XS">
|
||||
<rect key="frame" x="112" y="13" width="37" height="17"/>
|
||||
<rect key="frame" x="131" y="18" width="37" height="17"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="jZ4-pa-K3T">
|
||||
<font key="font" usesAppearanceFont="YES"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -57,14 +67,19 @@
|
||||
<constraints>
|
||||
<constraint firstItem="ohB-P0-nCv" firstAttribute="leading" secondItem="Ydb-7n-5Cd" secondAttribute="trailing" constant="10" id="3wD-FP-vka"/>
|
||||
<constraint firstItem="TPv-k2-6XS" firstAttribute="leading" secondItem="ohB-P0-nCv" secondAttribute="leading" id="4qb-9H-TVg"/>
|
||||
<constraint firstItem="Ydb-7n-5Cd" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="8hv-Qt-uAI"/>
|
||||
<constraint firstItem="Ydb-7n-5Cd" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="3" id="8hv-Qt-uAI"/>
|
||||
<constraint firstItem="xJW-ps-ycn" firstAttribute="leading" secondItem="ohB-P0-nCv" secondAttribute="leading" id="DYk-9g-adD"/>
|
||||
<constraint firstItem="ohB-P0-nCv" firstAttribute="top" secondItem="xJW-ps-ycn" secondAttribute="bottom" constant="-3" id="Epo-on-wpL"/>
|
||||
<constraint firstItem="97z-d7-S3D" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="3" id="FbP-R4-bAA"/>
|
||||
<constraint firstItem="3Ha-ZH-fa9" firstAttribute="centerY" secondItem="ohB-P0-nCv" secondAttribute="centerY" id="Flo-4k-Vaz"/>
|
||||
<constraint firstItem="3Ha-ZH-fa9" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="xJW-ps-ycn" secondAttribute="trailing" constant="10" id="NxZ-be-5y0"/>
|
||||
<constraint firstItem="xnT-RR-pOf" firstAttribute="leading" secondItem="Ydb-7n-5Cd" secondAttribute="leading" id="O8E-35-EK3"/>
|
||||
<constraint firstAttribute="trailing" secondItem="3Ha-ZH-fa9" secondAttribute="trailing" constant="14" id="SVJ-UL-O5m"/>
|
||||
<constraint firstAttribute="bottom" secondItem="97z-d7-S3D" secondAttribute="bottom" constant="3" id="XfR-Fd-n6o"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Ydb-7n-5Cd" secondAttribute="bottom" constant="3" id="aVd-Ld-lUH"/>
|
||||
<constraint firstItem="97z-d7-S3D" firstAttribute="trailing" secondItem="Ydb-7n-5Cd" secondAttribute="trailing" id="bzC-Km-KOo"/>
|
||||
<constraint firstItem="3Ha-ZH-fa9" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="TPv-k2-6XS" secondAttribute="trailing" constant="10" id="feB-7H-8HN"/>
|
||||
<constraint firstItem="xnT-RR-pOf" firstAttribute="centerY" secondItem="97z-d7-S3D" secondAttribute="centerY" id="gLa-2C-g8X"/>
|
||||
<constraint firstItem="Ydb-7n-5Cd" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="3" id="iPZ-zR-jTv"/>
|
||||
<constraint firstItem="ohB-P0-nCv" firstAttribute="centerY" secondItem="c22-O7-iKe" secondAttribute="centerY" id="mGo-gc-dR6"/>
|
||||
<constraint firstItem="TPv-k2-6XS" firstAttribute="top" secondItem="ohB-P0-nCv" secondAttribute="bottom" constant="-3" id="vSW-bd-8ac"/>
|
||||
@ -72,6 +87,8 @@
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="artistTextField" destination="TPv-k2-6XS" id="jJV-4C-USY"/>
|
||||
<outlet property="audioArtworkImageView" destination="97z-d7-S3D" id="ZDl-d6-j29"/>
|
||||
<outlet property="audioMediaTypeIndicator" destination="xnT-RR-pOf" id="BTq-M6-aJm"/>
|
||||
<outlet property="durationTextField" destination="3Ha-ZH-fa9" id="vbh-oE-Afj"/>
|
||||
<outlet property="mediaImageView" destination="Ydb-7n-5Cd" id="MlE-WQ-VB9"/>
|
||||
<outlet property="mediaTitleTextField" destination="ohB-P0-nCv" id="iS6-q4-h8I"/>
|
||||
@ -80,4 +97,7 @@
|
||||
<point key="canvasLocation" x="98" y="50.5"/>
|
||||
</customView>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="note" width="24" height="24"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
@ -190,7 +190,7 @@ const CGFloat VLCLibraryWindowLargeRowHeight = 50.;
|
||||
[_mediaSourceCollectionView registerClass:[VLCMediaSourceCollectionViewItem class] forItemWithIdentifier:VLCMediaSourceCellIdentifier];
|
||||
|
||||
self.upNextLabel.font = [NSFont VLClibrarySectionHeaderFont];
|
||||
self.upNextLabel.stringValue = _NS("Up next");
|
||||
self.upNextLabel.stringValue = _NS("Playlist");
|
||||
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:_NS("Clear queue")
|
||||
attributes:@{NSFontAttributeName : [NSFont VLClibraryButtonFont],
|
||||
NSForegroundColorAttributeName : [NSColor VLClibraryHighlightColor]}];
|
||||
|
@ -22,14 +22,12 @@
|
||||
|
||||
#import "VLCPlaylistDataSource.h"
|
||||
|
||||
#import "extensions/NSString+Helpers.h"
|
||||
#import "main/VLCMain.h"
|
||||
#import "playlist/VLCPlaylistController.h"
|
||||
#import "playlist/VLCPlaylistTableCellView.h"
|
||||
#import "playlist/VLCPlaylistItem.h"
|
||||
#import "playlist/VLCPlaylistModel.h"
|
||||
#import "views/VLCDragDropView.h"
|
||||
#import "views/VLCImageView.h"
|
||||
|
||||
static NSString *VLCPlaylistCellIdentifier = @"VLCPlaylistCellIdentifier";
|
||||
|
||||
@ -80,22 +78,7 @@ static NSString *VLCPlaylistCellIdentifier = @"VLCPlaylistCellIdentifier";
|
||||
return cellView;
|
||||
}
|
||||
|
||||
NSString *artist = item.artistName;
|
||||
if (artist && artist.length > 0) {
|
||||
cellView.mediaTitleTextField.hidden = YES;
|
||||
cellView.secondaryMediaTitleTextField.hidden = NO;
|
||||
cellView.artistTextField.hidden = NO;
|
||||
cellView.secondaryMediaTitleTextField.stringValue = item.title;
|
||||
cellView.artistTextField.stringValue = artist;
|
||||
} else {
|
||||
cellView.mediaTitleTextField.hidden = NO;
|
||||
cellView.secondaryMediaTitleTextField.hidden = YES;
|
||||
cellView.artistTextField.hidden = YES;
|
||||
cellView.mediaTitleTextField.stringValue = item.title;
|
||||
}
|
||||
|
||||
cellView.durationTextField.stringValue = [NSString stringWithTimeFromTicks:item.duration];
|
||||
cellView.mediaImageView.image = item.artworkImage;
|
||||
cellView.representedPlaylistItem = item;
|
||||
cellView.representsCurrentPlaylistItem = _playlistController.currentPlaylistIndex == row;
|
||||
|
||||
return cellView;
|
||||
|
@ -23,17 +23,22 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class VLCImageView;
|
||||
@class VLCPlaylistItem;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface VLCPlaylistTableCellView : NSTableCellView
|
||||
|
||||
@property (readwrite, assign, nonatomic) VLCPlaylistItem *representedPlaylistItem;
|
||||
@property (readwrite, nonatomic) BOOL representsCurrentPlaylistItem;
|
||||
|
||||
@property (readwrite, assign) IBOutlet NSTextField *artistTextField;
|
||||
@property (readwrite, assign) IBOutlet NSTextField *secondaryMediaTitleTextField;
|
||||
@property (readwrite, assign) IBOutlet NSTextField *mediaTitleTextField;
|
||||
@property (readwrite, assign) IBOutlet NSTextField *durationTextField;
|
||||
@property (readwrite, assign) IBOutlet VLCImageView *mediaImageView;
|
||||
@property (readwrite, assign) IBOutlet NSImageView *audioMediaTypeIndicator;
|
||||
@property (readwrite, assign) IBOutlet VLCImageView *audioArtworkImageView;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -21,7 +21,10 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#import "VLCPlaylistTableCellView.h"
|
||||
#import "extensions/NSString+Helpers.h"
|
||||
#import "extensions/NSFont+VLCAdditions.h"
|
||||
#import "playlist/VLCPlaylistItem.h"
|
||||
#import "views/VLCImageView.h"
|
||||
|
||||
@implementation VLCPlaylistTableCellView
|
||||
|
||||
@ -33,4 +36,31 @@
|
||||
self.secondaryMediaTitleTextField.font = displayedFont;
|
||||
}
|
||||
|
||||
- (void)setRepresentedPlaylistItem:(VLCPlaylistItem *)item
|
||||
{
|
||||
NSString *artist = item.artistName;
|
||||
if (artist && artist.length > 0) {
|
||||
self.mediaTitleTextField.hidden = YES;
|
||||
self.secondaryMediaTitleTextField.hidden = NO;
|
||||
self.artistTextField.hidden = NO;
|
||||
self.secondaryMediaTitleTextField.stringValue = item.title;
|
||||
self.artistTextField.stringValue = artist;
|
||||
self.audioArtworkImageView.image = item.artworkImage;
|
||||
self.audioMediaTypeIndicator.hidden = NO;
|
||||
self.mediaImageView.hidden = YES;
|
||||
} else {
|
||||
self.mediaTitleTextField.hidden = NO;
|
||||
self.secondaryMediaTitleTextField.hidden = YES;
|
||||
self.artistTextField.hidden = YES;
|
||||
self.mediaTitleTextField.stringValue = item.title;
|
||||
self.mediaImageView.image = item.artworkImage;
|
||||
self.audioArtworkImageView.hidden = YES;
|
||||
self.audioMediaTypeIndicator.hidden = YES;
|
||||
}
|
||||
|
||||
self.durationTextField.stringValue = [NSString stringWithTimeFromTicks:item.duration];
|
||||
|
||||
_representedPlaylistItem = item;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user