[vlc-commits] [Git][videolan/vlc][master] macosx: Add a highlight to library view collection view
Rémi Denis-Courmont (@Courmisch)
gitlab at videolan.org
Sun Sep 4 16:11:09 UTC 2022
Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
38e17000 by Claudio Cambra at 2022-09-04T15:56:49+00:00
macosx: Add a highlight to library view collection view
Signed-off-by: Claudio Cambra <claudio.cambra at gmail.com>
- - - - -
4 changed files:
- modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
- modules/gui/macosx/UI/VLCLibrarySongTableCellView.xib
- modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
- modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
Changes:
=====================================
modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
=====================================
@@ -10,6 +10,7 @@
<outlet property="addToPlaylistButton" destination="Ubz-8I-W2F" id="k0q-b1-PZi"/>
<outlet property="annotationTextField" destination="tm2-NW-WsZ" id="Miy-RS-Rol"/>
<outlet property="durationTextField" destination="VAn-gF-QiZ" id="U8T-Cs-HaL"/>
+ <outlet property="highlightBox" destination="Vwd-1n-Sbd" id="h1g-hL-1gh"/>
<outlet property="mediaImageView" destination="2aB-sB-hfY" id="Sv0-G1-KNm"/>
<outlet property="mediaTitleTextField" destination="OBS-Eh-1mT" id="h1n-PU-IAx"/>
<outlet property="playInstantlyButton" destination="S3I-5Z-qgS" id="JlC-bE-i5Y"/>
@@ -61,6 +62,14 @@
<constraint firstAttribute="trailing" secondItem="dFt-oZ-h9P" secondAttribute="trailing" id="kBI-UU-vnc"/>
</constraints>
</customView>
+ <box boxType="custom" borderType="line" borderWidth="5" cornerRadius="4" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Vwd-1n-Sbd">
+ <rect key="frame" x="0.0" y="51" width="212" height="212"/>
+ <view key="contentView" id="HJG-tt-Xh8">
+ <rect key="frame" x="5" y="5" width="202" height="202"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ </view>
+ <color key="borderColor" red="1" green="0.38123786450000002" blue="0.039215686270000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+ </box>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OBS-Eh-1mT">
<rect key="frame" x="-2" y="23" width="52" height="24"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" usesSingleLineMode="YES" id="7Hy-o3-LvX">
@@ -110,10 +119,14 @@
<constraint firstItem="u2r-zy-XEW" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="VAn-gF-QiZ" secondAttribute="trailing" constant="4" id="IXL-bv-5zP"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="VAn-gF-QiZ" secondAttribute="bottom" id="Kp0-Hx-3Ek"/>
<constraint firstItem="VAn-gF-QiZ" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="QUW-dn-Fbc"/>
+ <constraint firstItem="Vwd-1n-Sbd" firstAttribute="top" secondItem="2aB-sB-hfY" secondAttribute="top" id="Qpt-yS-z2k"/>
+ <constraint firstItem="Vwd-1n-Sbd" firstAttribute="leading" secondItem="2aB-sB-hfY" secondAttribute="leading" id="Yqz-VL-Ul7"/>
<constraint firstAttribute="trailing" secondItem="Ubz-8I-W2F" secondAttribute="trailing" constant="14" id="ZVz-SL-rxZ"/>
<constraint firstItem="tm2-NW-WsZ" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="7" id="cvk-A5-enS"/>
<constraint firstItem="tm2-NW-WsZ" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="10" id="fH0-Om-7gV"/>
+ <constraint firstItem="Vwd-1n-Sbd" firstAttribute="trailing" secondItem="2aB-sB-hfY" secondAttribute="trailing" id="fag-50-6qS"/>
<constraint firstAttribute="trailing" secondItem="2aB-sB-hfY" secondAttribute="trailing" id="oZw-Ab-83p"/>
+ <constraint firstItem="Vwd-1n-Sbd" firstAttribute="bottom" secondItem="2aB-sB-hfY" secondAttribute="bottom" id="sIE-go-0nP"/>
<constraint firstItem="2aB-sB-hfY" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="t9g-tX-AQX"/>
<constraint firstItem="OBS-Eh-1mT" firstAttribute="top" secondItem="2aB-sB-hfY" secondAttribute="bottom" constant="4" id="vJy-Kf-4Jh"/>
<constraint firstItem="OBS-Eh-1mT" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="yvp-xr-geN"/>
=====================================
modules/gui/macosx/UI/VLCLibrarySongTableCellView.xib
=====================================
@@ -35,7 +35,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NFZ-x0-t5c">
- <rect key="frame" x="10" y="7" width="12" height="36"/>
+ <rect key="frame" x="10" y="7" width="12.5" height="36"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="bai-RH-huE"/>
</constraints>
=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
=====================================
@@ -40,6 +40,7 @@ extern NSString *VLCLibraryCellIdentifier;
@property (readwrite, assign) IBOutlet NSButton *playInstantlyButton;
@property (readwrite, assign) IBOutlet NSButton *addToPlaylistButton;
@property (readwrite, assign) IBOutlet VLCLinearProgressIndicator *progressIndicator;
+ at property (readwrite, assign) IBOutlet NSBox *highlightBox;
@property (readwrite, retain, nonatomic) id<VLCMediaLibraryItemProtocol> representedItem;
=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
=====================================
@@ -83,6 +83,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
self.unplayedIndicatorTextField.stringValue = _NS("NEW");
self.unplayedIndicatorTextField.font = [NSFont VLClibraryHighlightCellHighlightLabelFont];
self.unplayedIndicatorTextField.textColor = [NSColor VLClibraryHighlightColor];
+ self.highlightBox.borderColor = [NSColor VLCOrangeElementColor];
if (@available(macOS 10.14, *)) {
[[NSApplication sharedApplication] addObserver:self
@@ -134,6 +135,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
_annotationTextField.hidden = YES;
_progressIndicator.hidden = YES;
_unplayedIndicatorTextField.hidden = YES;
+ _highlightBox.hidden = YES;
}
- (void)setRepresentedItem:(id<VLCMediaLibraryItemProtocol>)representedItem
@@ -146,6 +148,12 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
[self updateRepresentation];
}
+- (void)setSelected:(BOOL)selected
+{
+ super.selected = selected;
+ _highlightBox.hidden = !selected;
+}
+
- (void)mediaItemUpdated:(NSNotification *)aNotification
{
VLCMediaLibraryMediaItem *updatedMediaItem = aNotification.object;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/38e17000d1eb39327b4adc9a946d1339adc58b33
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/38e17000d1eb39327b4adc9a946d1339adc58b33
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