Browse Source

macosx/playlist: add chrome based on design

pull/90/head
Felix Paul Kühne 7 years ago
parent
commit
2bd7b3e521
  1. 12
      extras/package/macosx/VLC.xcodeproj/project.pbxproj
  2. 10
      modules/gui/macosx/Makefile.am
  3. BIN
      modules/gui/macosx/Resources/librarywindow/repeatAll.png
  4. BIN
      modules/gui/macosx/Resources/librarywindow/repeatAll@2x.png
  5. BIN
      modules/gui/macosx/Resources/librarywindow/repeatOff.png
  6. BIN
      modules/gui/macosx/Resources/librarywindow/repeatOff@2x.png
  7. BIN
      modules/gui/macosx/Resources/librarywindow/repeatOne.png
  8. BIN
      modules/gui/macosx/Resources/librarywindow/repeatOne@2x.png
  9. BIN
      modules/gui/macosx/Resources/librarywindow/shuffleOff.png
  10. BIN
      modules/gui/macosx/Resources/librarywindow/shuffleOff@2x.png
  11. BIN
      modules/gui/macosx/Resources/librarywindow/shuffleOn.png
  12. BIN
      modules/gui/macosx/Resources/librarywindow/shuffleOn@2x.png
  13. 79
      modules/gui/macosx/UI/VLCLibraryWindow.xib
  14. 1
      modules/gui/macosx/extensions/NSFont+VLCAdditions.h
  15. 5
      modules/gui/macosx/extensions/NSFont+VLCAdditions.m
  16. 2
      modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
  17. 6
      modules/gui/macosx/library/VLCLibraryWindow.h
  18. 47
      modules/gui/macosx/library/VLCLibraryWindow.m

12
extras/package/macosx/VLC.xcodeproj/project.pbxproj

@ -449,6 +449,12 @@
7D28E63E2275C8660098D30E /* ellipsis@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ellipsis@2x.png"; path = "librarywindow/ellipsis@2x.png"; sourceTree = "<group>"; };
7D28E63F2275C9C70098D30E /* libraryPlay@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "libraryPlay@2x.png"; path = "librarywindow/libraryPlay@2x.png"; sourceTree = "<group>"; };
7D28E6402275C9C70098D30E /* libraryPlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = libraryPlay.png; path = librarywindow/libraryPlay.png; sourceTree = "<group>"; };
7D28E6442275F2840098D30E /* repeatOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "repeatOff@2x.png"; path = "librarywindow/repeatOff@2x.png"; sourceTree = "<group>"; };
7D28E6452275F2840098D30E /* shuffleOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "shuffleOn@2x.png"; path = "librarywindow/shuffleOn@2x.png"; sourceTree = "<group>"; };
7D28E6462275F2850098D30E /* repeatOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeatOff.png; path = librarywindow/repeatOff.png; sourceTree = "<group>"; };
7D28E6472275F2850098D30E /* repeatOne@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "repeatOne@2x.png"; path = "librarywindow/repeatOne@2x.png"; sourceTree = "<group>"; };
7D28E6482275F2850098D30E /* repeatOne.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeatOne.png; path = librarywindow/repeatOne.png; sourceTree = "<group>"; };
7D28E6492275F2850098D30E /* shuffleOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = shuffleOn.png; path = librarywindow/shuffleOn.png; sourceTree = "<group>"; };
7D2E0ED920CD204D0033A221 /* VLCWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCWindow.m; sourceTree = "<group>"; };
7D2E0EDA20CD204D0033A221 /* VLCWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCWindow.h; sourceTree = "<group>"; };
7D2E0EDC20CD206F0033A221 /* VLCVideoWindowCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCVideoWindowCommon.h; sourceTree = "<group>"; };
@ -1300,6 +1306,12 @@
7D28E63E2275C8660098D30E /* ellipsis@2x.png */,
7D28E6402275C9C70098D30E /* libraryPlay.png */,
7D28E63F2275C9C70098D30E /* libraryPlay@2x.png */,
7D28E6462275F2850098D30E /* repeatOff.png */,
7D28E6442275F2840098D30E /* repeatOff@2x.png */,
7D28E6482275F2850098D30E /* repeatOne.png */,
7D28E6472275F2850098D30E /* repeatOne@2x.png */,
7D28E6492275F2850098D30E /* shuffleOn.png */,
7D28E6452275F2840098D30E /* shuffleOn@2x.png */,
);
name = "Library Window";
sourceTree = "<group>";

10
modules/gui/macosx/Makefile.am

@ -301,6 +301,16 @@ libmacosx_plugin_la_RES = \
gui/macosx/Resources/librarywindow/ellipsis@2x.png \
gui/macosx/Resources/librarywindow/libraryPlay.png \
gui/macosx/Resources/librarywindow/libraryPlay@2x.png \
gui/macosx/Resources/librarywindow/repeatAll.png \
gui/macosx/Resources/librarywindow/repeatAll@2x.png \
gui/macosx/Resources/librarywindow/repeatOff.png \
gui/macosx/Resources/librarywindow/repeatOff@2x.png \
gui/macosx/Resources/librarywindow/repeatOne.png \
gui/macosx/Resources/librarywindow/repeatOne@2x.png \
gui/macosx/Resources/librarywindow/shuffleOff.png \
gui/macosx/Resources/librarywindow/shuffleOff@2x.png \
gui/macosx/Resources/librarywindow/shuffleOn.png \
gui/macosx/Resources/librarywindow/shuffleOn@2x.png \
gui/macosx/Resources/mainwindow/backward-3btns-pressed.png \
gui/macosx/Resources/mainwindow/backward-3btns-pressed@2x.png \
gui/macosx/Resources/mainwindow/backward-3btns.png \

BIN
modules/gui/macosx/Resources/librarywindow/repeatAll.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
modules/gui/macosx/Resources/librarywindow/repeatAll@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
modules/gui/macosx/Resources/librarywindow/repeatOff.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
modules/gui/macosx/Resources/librarywindow/repeatOff@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

BIN
modules/gui/macosx/Resources/librarywindow/repeatOne.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

BIN
modules/gui/macosx/Resources/librarywindow/repeatOne@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

BIN
modules/gui/macosx/Resources/librarywindow/shuffleOff.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
modules/gui/macosx/Resources/librarywindow/shuffleOff@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
modules/gui/macosx/Resources/librarywindow/shuffleOn.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

BIN
modules/gui/macosx/Resources/librarywindow/shuffleOn@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

79
modules/gui/macosx/UI/VLCLibraryWindow.xib

@ -111,20 +111,31 @@
<rect key="frame" x="243" y="0.0" width="237" height="291"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Vry-OZ-ySI">
<rect key="frame" x="18" y="274" width="51" height="17"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Up next" id="7PB-pT-1Xp">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="qmL-Ar-cj1">
<rect key="frame" x="20" y="247" width="197" height="5"/>
</box>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Z7y-D0-11Q">
<rect key="frame" x="0.0" y="0.0" width="237" height="291"/>
<rect key="frame" x="20" y="63" width="217" height="178"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Vdr-bg-tuS">
<rect key="frame" x="0.0" y="0.0" width="237" height="291"/>
<rect key="frame" x="0.0" y="0.0" width="217" height="178"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="Fr1-af-8gb" customClass="VLCPlaylistTableView">
<rect key="frame" x="0.0" y="0.0" width="237" height="291"/>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="Fr1-af-8gb" customClass="VLCPlaylistTableView">
<rect key="frame" x="0.0" y="0.0" width="217" height="178"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="234" minWidth="40" maxWidth="1000" id="gkH-E7-Nn4">
<tableColumn width="214" minWidth="40" maxWidth="1000" id="gkH-E7-Nn4">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@ -138,11 +149,11 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="3Pj-5C-4K4">
<rect key="frame" x="1" y="1" width="234" height="17"/>
<rect key="frame" x="1" y="1" width="214" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dY4-Im-HRr">
<rect key="frame" x="0.0" y="0.0" width="234" height="17"/>
<rect key="frame" x="0.0" y="0.0" width="214" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="vlq-wz-y8v">
<font key="font" metaFont="system"/>
@ -175,12 +186,50 @@
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="nAW-KH-ipk">
<rect key="frame" x="20" y="52" width="197" height="5"/>
</box>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jg5-33-vH0">
<rect key="frame" x="20" y="15" width="24" height="24"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="shuffleOn" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="J31-h3-U4s">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8zF-Wo-H79">
<rect key="frame" x="64" y="15" width="24" height="24"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="repeatOff" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="ol2-xi-TEm">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cih-xp-HmY">
<rect key="frame" x="133" y="15" width="84" height="17"/>
<buttonCell key="cell" type="square" title="Empty queue" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="OjM-W9-IrQ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
</subviews>
<constraints>
<constraint firstItem="Z7y-D0-11Q" firstAttribute="leading" secondItem="dus-WQ-AmE" secondAttribute="leading" id="J3s-se-6bL"/>
<constraint firstAttribute="bottom" secondItem="Z7y-D0-11Q" secondAttribute="bottom" id="XsQ-oc-D77"/>
<constraint firstItem="Vry-OZ-ySI" firstAttribute="leading" secondItem="dus-WQ-AmE" secondAttribute="leading" constant="20" id="6iz-2G-xXO"/>
<constraint firstItem="qmL-Ar-cj1" firstAttribute="top" secondItem="Vry-OZ-ySI" secondAttribute="bottom" constant="24" id="De2-Wf-QsC"/>
<constraint firstItem="nAW-KH-ipk" firstAttribute="leading" secondItem="dus-WQ-AmE" secondAttribute="leading" constant="20" id="EUp-9J-Fid"/>
<constraint firstItem="Z7y-D0-11Q" firstAttribute="top" secondItem="qmL-Ar-cj1" secondAttribute="bottom" constant="8" id="GIh-g3-rqJ"/>
<constraint firstItem="Z7y-D0-11Q" firstAttribute="leading" secondItem="dus-WQ-AmE" secondAttribute="leading" constant="20" id="J3s-se-6bL"/>
<constraint firstItem="Vry-OZ-ySI" firstAttribute="top" secondItem="dus-WQ-AmE" secondAttribute="top" id="K80-Vw-FfD"/>
<constraint firstItem="8zF-Wo-H79" firstAttribute="centerY" secondItem="jg5-33-vH0" secondAttribute="centerY" id="Qdp-7K-RkD"/>
<constraint firstItem="Z7y-D0-11Q" firstAttribute="baseline" secondItem="nAW-KH-ipk" secondAttribute="firstBaseline" constant="-8" id="ZIg-X2-w2p"/>
<constraint firstAttribute="trailing" secondItem="cih-xp-HmY" secondAttribute="trailing" constant="20" id="ZmV-zc-4a0"/>
<constraint firstItem="8zF-Wo-H79" firstAttribute="leading" secondItem="jg5-33-vH0" secondAttribute="trailing" constant="20" id="aAn-lh-NcZ"/>
<constraint firstAttribute="trailing" secondItem="nAW-KH-ipk" secondAttribute="trailing" constant="20" id="d3t-R3-45M"/>
<constraint firstAttribute="trailing" secondItem="qmL-Ar-cj1" secondAttribute="trailing" constant="20" id="epP-za-NOo"/>
<constraint firstAttribute="bottom" secondItem="cih-xp-HmY" secondAttribute="bottom" constant="15" id="jRf-7P-2Vc"/>
<constraint firstItem="qmL-Ar-cj1" firstAttribute="leading" secondItem="dus-WQ-AmE" secondAttribute="leading" constant="20" id="st7-tK-qLh"/>
<constraint firstAttribute="trailing" secondItem="Z7y-D0-11Q" secondAttribute="trailing" id="x0A-xI-BVt"/>
<constraint firstItem="Z7y-D0-11Q" firstAttribute="top" secondItem="dus-WQ-AmE" secondAttribute="top" id="zDU-QJ-fx4"/>
<constraint firstItem="jg5-33-vH0" firstAttribute="firstBaseline" secondItem="cih-xp-HmY" secondAttribute="firstBaseline" id="xwe-Nb-2Rz"/>
<constraint firstAttribute="bottom" secondItem="nAW-KH-ipk" secondAttribute="bottom" constant="54" id="z8O-Xk-fS8"/>
<constraint firstItem="jg5-33-vH0" firstAttribute="leading" secondItem="dus-WQ-AmE" secondAttribute="leading" constant="20" id="zEw-GJ-NfA"/>
</constraints>
</customView>
</subviews>
@ -325,11 +374,17 @@
</constraints>
</view>
<connections>
<outlet property="clearPlaylistButton" destination="cih-xp-HmY" id="PoU-co-0kn"/>
<outlet property="clearPlaylistSeparator" destination="nAW-KH-ipk" id="Af9-fg-u7m"/>
<outlet property="libraryCollectionView" destination="B8x-e8-7zp" id="djF-Lw-nXT"/>
<outlet property="mediaSourceCollectionView" destination="r7v-GI-W1U" id="3JJ-GU-o5o"/>
<outlet property="mediaSourceScrollView" destination="cFG-c9-cI9" id="gRO-Y7-kdb"/>
<outlet property="playlistTableView" destination="Fr1-af-8gb" id="yaB-Ab-jrx"/>
<outlet property="repeatPlaylistButton" destination="8zF-Wo-H79" id="6bH-HF-arx"/>
<outlet property="segmentedTitleControl" destination="W1M-0o-qYG" id="Gw1-T6-78k"/>
<outlet property="shufflePlaylistButton" destination="jg5-33-vH0" id="FV2-36-3lG"/>
<outlet property="upNextLabel" destination="Vry-OZ-ySI" id="KxM-oZ-tSg"/>
<outlet property="upNextSeparator" destination="qmL-Ar-cj1" id="GRX-ZE-2UG"/>
<outlet property="videoView" destination="12s-0J-Uvj" id="zTg-s0-qZ5"/>
</connections>
<point key="canvasLocation" x="139" y="204.5"/>
@ -356,5 +411,7 @@
<image name="fullscreen-one-button-pressed" width="29" height="23"/>
<image name="play" width="27" height="23"/>
<image name="play-pressed" width="27" height="23"/>
<image name="repeatOff" width="24" height="24"/>
<image name="shuffleOn" width="24" height="24"/>
</resources>
</document>

1
modules/gui/macosx/extensions/NSFont+VLCAdditions.h

@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)VLClibraryCellTitleFont;
+ (instancetype)VLClibraryCellSubtitleFont;
+ (instancetype)VLClibraryCellAnnotationFont;
+ (instancetype)VLClibraryButtonFont;
@end

5
modules/gui/macosx/extensions/NSFont+VLCAdditions.m

@ -59,4 +59,9 @@
return [NSFont systemFontOfSize:15. weight:NSFontWeightBold];
}
+ (instancetype)VLClibraryButtonFont
{
return [NSFont systemFontOfSize:15. weight:NSFontWeightBold];
}
@end

2
modules/gui/macosx/library/VLCLibraryCollectionViewItem.m

@ -68,8 +68,6 @@ NSString *VLCLibraryCellIdentifier = @"VLCLibraryCellIdentifier";
self.annotationTextField.font = [NSFont VLClibraryCellAnnotationFont];
self.annotationTextField.textColor = [NSColor VLClibraryAnnotationColor];
self.annotationTextField.backgroundColor = [NSColor VLClibraryAnnotationBackgroundColor];
self.annotationTextField.bezeled = YES;
self.annotationTextField.bezelStyle = NSTextFieldRoundedBezel;
if (@available(macOS 10_14, *)) {
[[NSApplication sharedApplication] addObserver:self

6
modules/gui/macosx/library/VLCLibraryWindow.h

@ -40,6 +40,12 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, weak) IBOutlet NSCollectionView *mediaSourceCollectionView;
@property (readwrite, weak) IBOutlet NSScrollView *mediaSourceScrollView;
@property (readwrite, weak) IBOutlet NSTableView *playlistTableView;
@property (readwrite, weak) IBOutlet NSTextField *upNextLabel;
@property (readwrite, weak) IBOutlet NSBox *upNextSeparator;
@property (readwrite, weak) IBOutlet NSButton *clearPlaylistButton;
@property (readwrite, weak) IBOutlet NSBox *clearPlaylistSeparator;
@property (readwrite, weak) IBOutlet NSButton *repeatPlaylistButton;
@property (readwrite, weak) IBOutlet NSButton *shufflePlaylistButton;
@property (readonly) BOOL nativeFullscreenMode;
@property (readwrite) BOOL nonembedded;

47
modules/gui/macosx/library/VLCLibraryWindow.m

@ -22,6 +22,8 @@
#import "VLCLibraryWindow.h"
#import "extensions/NSString+Helpers.h"
#import "extensions/NSFont+VLCAdditions.h"
#import "extensions/NSColor+VLCAdditions.h"
#import "main/VLCMain.h"
#import "playlist/VLCPlaylistTableCellView.h"
@ -74,6 +76,12 @@ static const float f_playlist_row_height = 72.;
selector:@selector(updateLibraryRepresentation:)
name:VLCLibraryModelVideoMediaListUpdated
object:nil];
if (@available(macOS 10_14, *)) {
[[NSApplication sharedApplication] addObserver:self
forKeyPath:@"effectiveAppearance"
options:0
context:nil];
}
_fspanel = [[VLCFSPanelController alloc] init];
[_fspanel showWindow:self];
@ -111,12 +119,51 @@ static const float f_playlist_row_height = 72.;
_mediaSourceCollectionView.delegate = _mediaSourceDataSource;
[_mediaSourceCollectionView registerClass:[VLCMediaSourceCollectionViewItem class] forItemWithIdentifier:VLCMediaSourceCellIdentifier];
self.upNextLabel.font = [NSFont VLClibrarySectionHeaderFont];
self.upNextLabel.stringValue = _NS("Up next");
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:_NS("Clear queue")
attributes:@{NSFontAttributeName : [NSFont VLClibraryButtonFont],
NSForegroundColorAttributeName : [NSColor VLClibraryHighlightColor]}];
self.clearPlaylistButton.attributedTitle = attributedTitle;
[self updateColorsBasedOnAppearance];
[self segmentedControlAction:nil];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (@available(macOS 10_14, *)) {
[[NSApplication sharedApplication] removeObserver:self forKeyPath:@"effectiveAppearance"];
}
}
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary<NSKeyValueChangeKey,id> *)change
context:(void *)context
{
[self updateColorsBasedOnAppearance];
}
- (void)updateColorsBasedOnAppearance
{
if (@available(macOS 10_14, *)) {
if ([self.effectiveAppearance.name isEqualToString:NSAppearanceNameDarkAqua]) {
self.upNextLabel.textColor = [NSColor VLClibraryDarkTitleColor];
self.upNextSeparator.borderColor = [NSColor VLClibrarySeparatorDarkColor];
self.clearPlaylistSeparator.borderColor = [NSColor VLClibrarySeparatorDarkColor];
} else {
self.upNextLabel.textColor = [NSColor VLClibraryLightTitleColor];
self.upNextSeparator.borderColor = [NSColor VLClibrarySeparatorLightColor];
self.clearPlaylistSeparator.borderColor = [NSColor VLClibrarySeparatorLightColor];
}
} else {
self.upNextLabel.textColor = [NSColor VLClibraryLightTitleColor];
self.upNextSeparator.borderColor = [NSColor VLClibrarySeparatorLightColor];
self.clearPlaylistSeparator.borderColor = [NSColor VLClibrarySeparatorLightColor];
}
}
- (void)segmentedControlAction:(id)sender

Loading…
Cancel
Save