vlc | branch: master | Felix Paul Kühne <[email protected]> | Sun Apr 28 17:20:21 2019 +0200| [2bd7b3e5210fedc6d5c4fec88b162af48d9caa04] | committer: Felix Paul Kühne
macosx/playlist: add chrome based on design > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2bd7b3e5210fedc6d5c4fec88b162af48d9caa04 --- .../package/macosx/VLC.xcodeproj/project.pbxproj | 12 ++++ modules/gui/macosx/Makefile.am | 10 +++ .../macosx/Resources/librarywindow/repeatAll.png | Bin 0 -> 1982 bytes .../Resources/librarywindow/[email protected] | Bin 0 -> 3189 bytes .../macosx/Resources/librarywindow/repeatOff.png | Bin 0 -> 318 bytes .../Resources/librarywindow/[email protected] | Bin 0 -> 465 bytes .../macosx/Resources/librarywindow/repeatOne.png | Bin 0 -> 407 bytes .../Resources/librarywindow/[email protected] | Bin 0 -> 661 bytes .../macosx/Resources/librarywindow/shuffleOff.png | Bin 0 -> 2085 bytes .../Resources/librarywindow/[email protected] | Bin 0 -> 3889 bytes .../macosx/Resources/librarywindow/shuffleOn.png | Bin 0 -> 411 bytes .../Resources/librarywindow/[email protected] | Bin 0 -> 643 bytes modules/gui/macosx/UI/VLCLibraryWindow.xib | 79 ++++++++++++++++++--- .../gui/macosx/extensions/NSFont+VLCAdditions.h | 1 + .../gui/macosx/extensions/NSFont+VLCAdditions.m | 5 ++ .../macosx/library/VLCLibraryCollectionViewItem.m | 2 - modules/gui/macosx/library/VLCLibraryWindow.h | 6 ++ modules/gui/macosx/library/VLCLibraryWindow.m | 47 ++++++++++++ 18 files changed, 149 insertions(+), 13 deletions(-) diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj index cd17eb87d8..0dec0a06b3 100644 --- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj +++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj @@ -449,6 +449,12 @@ 7D28E63E2275C8660098D30E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "librarywindow/[email protected]"; sourceTree = "<group>"; }; 7D28E63F2275C9C70098D30E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "librarywindow/[email protected]"; sourceTree = "<group>"; }; 7D28E6402275C9C70098D30E /* libraryPlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = libraryPlay.png; path = librarywindow/libraryPlay.png; sourceTree = "<group>"; }; + 7D28E6442275F2840098D30E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "librarywindow/[email protected]"; sourceTree = "<group>"; }; + 7D28E6452275F2840098D30E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "librarywindow/[email protected]"; sourceTree = "<group>"; }; + 7D28E6462275F2850098D30E /* repeatOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = repeatOff.png; path = librarywindow/repeatOff.png; sourceTree = "<group>"; }; + 7D28E6472275F2850098D30E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "librarywindow/[email protected]"; 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 /* [email protected] */, 7D28E6402275C9C70098D30E /* libraryPlay.png */, 7D28E63F2275C9C70098D30E /* [email protected] */, + 7D28E6462275F2850098D30E /* repeatOff.png */, + 7D28E6442275F2840098D30E /* [email protected] */, + 7D28E6482275F2850098D30E /* repeatOne.png */, + 7D28E6472275F2850098D30E /* [email protected] */, + 7D28E6492275F2850098D30E /* shuffleOn.png */, + 7D28E6452275F2840098D30E /* [email protected] */, ); name = "Library Window"; sourceTree = "<group>"; diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am index fc804d9ffc..3216a04a88 100644 --- a/modules/gui/macosx/Makefile.am +++ b/modules/gui/macosx/Makefile.am @@ -301,6 +301,16 @@ libmacosx_plugin_la_RES = \ gui/macosx/Resources/librarywindow/[email protected] \ gui/macosx/Resources/librarywindow/libraryPlay.png \ gui/macosx/Resources/librarywindow/[email protected] \ + gui/macosx/Resources/librarywindow/repeatAll.png \ + gui/macosx/Resources/librarywindow/[email protected] \ + gui/macosx/Resources/librarywindow/repeatOff.png \ + gui/macosx/Resources/librarywindow/[email protected] \ + gui/macosx/Resources/librarywindow/repeatOne.png \ + gui/macosx/Resources/librarywindow/[email protected] \ + gui/macosx/Resources/librarywindow/shuffleOff.png \ + gui/macosx/Resources/librarywindow/[email protected] \ + gui/macosx/Resources/librarywindow/shuffleOn.png \ + gui/macosx/Resources/librarywindow/[email protected] \ gui/macosx/Resources/mainwindow/backward-3btns-pressed.png \ gui/macosx/Resources/mainwindow/[email protected] \ gui/macosx/Resources/mainwindow/backward-3btns.png \ diff --git a/modules/gui/macosx/Resources/librarywindow/repeatAll.png b/modules/gui/macosx/Resources/librarywindow/repeatAll.png new file mode 100644 index 0000000000..403e2cef90 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/repeatAll.png differ diff --git a/modules/gui/macosx/Resources/librarywindow/[email protected] b/modules/gui/macosx/Resources/librarywindow/[email protected] new file mode 100644 index 0000000000..5d8f4999d7 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/[email protected] differ diff --git a/modules/gui/macosx/Resources/librarywindow/repeatOff.png b/modules/gui/macosx/Resources/librarywindow/repeatOff.png new file mode 100644 index 0000000000..5a4a763927 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/repeatOff.png differ diff --git a/modules/gui/macosx/Resources/librarywindow/[email protected] b/modules/gui/macosx/Resources/librarywindow/[email protected] new file mode 100644 index 0000000000..ec59a4c582 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/[email protected] differ diff --git a/modules/gui/macosx/Resources/librarywindow/repeatOne.png b/modules/gui/macosx/Resources/librarywindow/repeatOne.png new file mode 100644 index 0000000000..517d4c1d72 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/repeatOne.png differ diff --git a/modules/gui/macosx/Resources/librarywindow/[email protected] b/modules/gui/macosx/Resources/librarywindow/[email protected] new file mode 100644 index 0000000000..da3d02ee4b Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/[email protected] differ diff --git a/modules/gui/macosx/Resources/librarywindow/shuffleOff.png b/modules/gui/macosx/Resources/librarywindow/shuffleOff.png new file mode 100644 index 0000000000..80317eaf2f Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/shuffleOff.png differ diff --git a/modules/gui/macosx/Resources/librarywindow/[email protected] b/modules/gui/macosx/Resources/librarywindow/[email protected] new file mode 100644 index 0000000000..1b976693a7 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/[email protected] differ diff --git a/modules/gui/macosx/Resources/librarywindow/shuffleOn.png b/modules/gui/macosx/Resources/librarywindow/shuffleOn.png new file mode 100644 index 0000000000..cab42fcc95 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/shuffleOn.png differ diff --git a/modules/gui/macosx/Resources/librarywindow/[email protected] b/modules/gui/macosx/Resources/librarywindow/[email protected] new file mode 100644 index 0000000000..04656d4962 Binary files /dev/null and b/modules/gui/macosx/Resources/librarywindow/[email protected] differ diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib b/modules/gui/macosx/UI/VLCLibraryWindow.xib index a5c5e0c1ad..00d19278ec 100644 --- a/modules/gui/macosx/UI/VLCLibraryWindow.xib +++ b/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> diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h index d7821528a6..df7058a7c1 100644 --- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.h +++ b/modules/gui/macosx/extensions/NSFont+VLCAdditions.h @@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)VLClibraryCellTitleFont; + (instancetype)VLClibraryCellSubtitleFont; + (instancetype)VLClibraryCellAnnotationFont; ++ (instancetype)VLClibraryButtonFont; @end diff --git a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m b/modules/gui/macosx/extensions/NSFont+VLCAdditions.m index ad81f37ef7..74c227c075 100644 --- a/modules/gui/macosx/extensions/NSFont+VLCAdditions.m +++ b/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 diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m index b907e5d8b0..2e6275ccca 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m +++ b/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 diff --git a/modules/gui/macosx/library/VLCLibraryWindow.h b/modules/gui/macosx/library/VLCLibraryWindow.h index 26e2766ec0..096ab4aeca 100644 --- a/modules/gui/macosx/library/VLCLibraryWindow.h +++ b/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; diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m b/modules/gui/macosx/library/VLCLibraryWindow.m index a6c5b96ced..b160244c7b 100644 --- a/modules/gui/macosx/library/VLCLibraryWindow.m +++ b/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 _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
