[vlc-commits] [Git][videolan/vlc][master] 3 commits: macosx: Add stack view parent to main video view controls bar title text field
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed May 3 12:36:50 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
6d62c3cc by Claudio Cambra at 2023-05-03T12:09:34+00:00
macosx: Add stack view parent to main video view controls bar title text field
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4b18b935 by Claudio Cambra at 2023-05-03T12:09:34+00:00
macosx: Add details field to main video view controls bar
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
893fd450 by Claudio Cambra at 2023-05-03T12:09:34+00:00
macosx: Set new detail label string value upon current playing item change in main video view controls bar
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
3 changed files:
- modules/gui/macosx/UI/VLCMainVideoView.xib
- modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.h
- modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.m
Changes:
=====================================
modules/gui/macosx/UI/VLCMainVideoView.xib
=====================================
@@ -33,6 +33,7 @@
<outlet property="audioButton" destination="cja-ZG-8LF" id="96C-CC-iV7"/>
<outlet property="backwardButton" destination="V9d-hX-iyg" id="ZFn-jn-7OB"/>
<outlet property="bookmarksButton" destination="4tZ-52-1q9" id="dAN-YB-YZ5"/>
+ <outlet property="detailLabel" destination="5ii-yU-6Zp" id="ves-8e-T8E"/>
<outlet property="forwardButton" destination="sF5-Z0-bef" id="H6w-Le-NAK"/>
<outlet property="fullscreenButton" destination="dYZ-ri-Kra" id="Cw2-BS-QG9"/>
<outlet property="fullscreenButtonWidthConstraint" destination="quS-fD-Od7" id="6hT-nR-yQI"/>
@@ -67,7 +68,7 @@
<rect key="frame" x="0.0" y="0.0" width="720" height="480"/>
</customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1GA-GG-Sdx">
- <rect key="frame" x="0.0" y="0.0" width="720" height="107"/>
+ <rect key="frame" x="0.0" y="0.0" width="720" height="132"/>
<subviews>
<textField wantsLayer="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f4v-2z-dQ1" customClass="VLCTimeField">
<rect key="frame" x="623" y="20" width="79" height="14"/>
@@ -80,14 +81,39 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField wantsLayer="YES" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="lEW-MN-FFU" customClass="VLCWrappableTextField">
- <rect key="frame" x="18" y="59" width="394" height="28"/>
- <textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" placeholderString="Nothing Playing" usesSingleLineMode="YES" id="8l0-zS-fOa">
- <font key="font" metaFont="systemBold" size="24"/>
- <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
+ <stackView distribution="fill" orientation="vertical" alignment="leading" spacing="4" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="San-L7-ZvB">
+ <rect key="frame" x="20" y="59" width="390" height="53"/>
+ <subviews>
+ <textField wantsLayer="YES" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="lEW-MN-FFU" customClass="VLCWrappableTextField">
+ <rect key="frame" x="-2" y="25" width="394" height="28"/>
+ <textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" placeholderString="Nothing Playing" usesSingleLineMode="YES" id="8l0-zS-fOa">
+ <font key="font" metaFont="systemBold" size="24"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5ii-yU-6Zp" customClass="VLCWrappableTextField">
+ <rect key="frame" x="-2" y="0.0" width="145" height="21"/>
+ <textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" placeholderString="No details to show" usesSingleLineMode="YES" id="k9I-DK-CEe">
+ <font key="font" textStyle="title2" name=".SFNS-Regular"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ </subviews>
+ <constraints>
+ <constraint firstAttribute="trailing" secondItem="lEW-MN-FFU" secondAttribute="trailing" id="HLa-BM-oRO"/>
+ <constraint firstItem="lEW-MN-FFU" firstAttribute="leading" secondItem="San-L7-ZvB" secondAttribute="leading" id="sH7-zW-49g"/>
+ </constraints>
+ <visibilityPriorities>
+ <integer value="1000"/>
+ <integer value="1000"/>
+ </visibilityPriorities>
+ <customSpacing>
+ <real value="3.4028234663852886e+38"/>
+ <real value="3.4028234663852886e+38"/>
+ </customSpacing>
+ </stackView>
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qNZ-Fh-W8i" customClass="VLCSlider">
<rect key="frame" x="18" y="37" width="684" height="19"/>
<constraints>
@@ -240,17 +266,17 @@
<constraints>
<constraint firstItem="f4v-2z-dQ1" firstAttribute="trailing" secondItem="qNZ-Fh-W8i" secondAttribute="trailing" id="0DA-7x-5iR"/>
<constraint firstAttribute="bottom" secondItem="3ri-8b-8mw" secondAttribute="bottom" constant="20" id="2r5-04-JeD"/>
+ <constraint firstItem="San-L7-ZvB" firstAttribute="leading" secondItem="qNZ-Fh-W8i" secondAttribute="leading" id="3nZ-hw-Q10"/>
<constraint firstItem="sJu-ZK-5QH" firstAttribute="trailing" secondItem="qNZ-Fh-W8i" secondAttribute="trailing" id="A0O-Nw-jLo"/>
<constraint firstItem="f4v-2z-dQ1" firstAttribute="top" secondItem="qNZ-Fh-W8i" secondAttribute="bottom" constant="5" id="CT6-59-4xB"/>
- <constraint firstItem="lEW-MN-FFU" firstAttribute="trailing" secondItem="sJu-ZK-5QH" secondAttribute="leading" constant="-20" id="DXE-mO-c4m"/>
- <constraint firstItem="lEW-MN-FFU" firstAttribute="leading" secondItem="qNZ-Fh-W8i" secondAttribute="leading" id="Qc0-Ft-6Na"/>
+ <constraint firstItem="San-L7-ZvB" firstAttribute="top" secondItem="1GA-GG-Sdx" secondAttribute="top" constant="20" id="V0e-id-yQj"/>
<constraint firstItem="sJu-ZK-5QH" firstAttribute="top" relation="greaterThanOrEqual" secondItem="1GA-GG-Sdx" secondAttribute="top" constant="10" id="Vjf-YQ-NXR"/>
<constraint firstItem="3ri-8b-8mw" firstAttribute="leading" secondItem="qNZ-Fh-W8i" secondAttribute="leading" id="WfQ-8B-O7I"/>
<constraint firstAttribute="trailing" secondItem="qNZ-Fh-W8i" secondAttribute="trailing" constant="20" id="YDi-aH-oOI"/>
- <constraint firstItem="lEW-MN-FFU" firstAttribute="top" secondItem="1GA-GG-Sdx" secondAttribute="top" constant="20" id="aCc-Gf-kqc"/>
- <constraint firstItem="lEW-MN-FFU" firstAttribute="bottom" secondItem="qNZ-Fh-W8i" secondAttribute="top" constant="-5" id="dxq-b6-tct"/>
<constraint firstItem="qNZ-Fh-W8i" firstAttribute="leading" secondItem="1GA-GG-Sdx" secondAttribute="leading" constant="20" id="gYg-Ig-cLg"/>
+ <constraint firstItem="San-L7-ZvB" firstAttribute="trailing" secondItem="sJu-ZK-5QH" secondAttribute="leading" constant="-20" id="jHc-ck-2xZ"/>
<constraint firstItem="3ri-8b-8mw" firstAttribute="top" secondItem="qNZ-Fh-W8i" secondAttribute="bottom" constant="5" id="jze-EU-1TL"/>
+ <constraint firstItem="San-L7-ZvB" firstAttribute="bottom" secondItem="qNZ-Fh-W8i" secondAttribute="top" constant="-5" id="pQq-HL-JgY"/>
<constraint firstItem="sJu-ZK-5QH" firstAttribute="bottom" secondItem="qNZ-Fh-W8i" secondAttribute="top" constant="-5" id="xsM-6a-gdn"/>
</constraints>
<shadow key="shadow" blurRadius="2">
=====================================
modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.h
=====================================
@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface VLCMainVideoViewControlsBar : VLCControlsBarCommon
+ at property (readwrite, strong) IBOutlet VLCWrappableTextField *detailLabel;
@property (readwrite, strong) IBOutlet NSButton *bookmarksButton;
@property (readwrite, strong) IBOutlet NSButton *subtitlesButton;
@property (readwrite, strong) IBOutlet NSButton *audioButton;
=====================================
modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.m
=====================================
@@ -24,6 +24,8 @@
#import "extensions/NSString+Helpers.h"
+#import "library/VLCLibraryDataTypes.h"
+
#import "main/VLCMain.h"
#import "menus/VLCMainMenu.h"
@@ -33,6 +35,15 @@
#import "playlist/VLCPlaylistController.h"
#import "playlist/VLCPlayerController.h"
+#import "views/VLCWrappableTextField.h"
+
+ at interface VLCMainVideoViewControlsBar ()
+{
+ VLCPlaylistController *_playlistController;
+ VLCPlayerController *_playerController;
+}
+ at end
+
@implementation VLCMainVideoViewControlsBar
- (void)awakeFromNib
@@ -47,6 +58,28 @@
_audioButton.toolTip = _NS("Audio settings");
_audioButton.accessibilityLabel = _audioButton.toolTip;
+
+ _playlistController = VLCMain.sharedInstance.playlistController;
+ _playerController = _playlistController.playerController;
+
+ NSNotificationCenter * const notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter addObserver:self
+ selector:@selector(updateDetailLabel:)
+ name:VLCPlayerCurrentMediaItemChanged
+ object:nil];
+}
+
+- (void)updateDetailLabel:(NSNotification *)notification
+{
+
+ VLCMediaLibraryMediaItem * const mediaItem = [VLCMediaLibraryMediaItem mediaItemForURL:_playerController.URLOfCurrentMediaItem];
+ if (!mediaItem) {
+ return;
+ }
+
+ _detailLabel.hidden = [mediaItem.detailString isEqualToString:@""] ||
+ [mediaItem.detailString isEqualToString:mediaItem.durationString];
+ _detailLabel.stringValue = mediaItem.detailString;
}
- (IBAction)openBookmarks:(id)sender
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dbab5e78b8b8d5b021c0a47ea2661468e56562ec...893fd450d52ac76ce832a22cb521068fb8f6e314
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dbab5e78b8b8d5b021c0a47ea2661468e56562ec...893fd450d52ac76ce832a22cb521068fb8f6e314
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