Commit 5bc13bb5 authored by Claudio Cambra's avatar Claudio Cambra Committed by Steve Lhomme
Browse files

macosx: Make trailing time field in playback control bas functional



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <developer@claudiocambra.com>
parent d7a9bc23
......@@ -19,24 +19,24 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="896" height="456"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="900"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<visualEffectView key="contentView" wantsLayer="YES" misplaced="YES" blendingMode="behindWindow" material="appearanceBased" state="followsWindowActiveState" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="896" height="456"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<splitView autosaveName="librarywindowsplitview" dividerStyle="thin" vertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="u8g-jy-S4e">
<rect key="frame" x="0.0" y="45" width="896" height="138"/>
<rect key="frame" x="0.0" y="45" width="896" height="134"/>
<subviews>
<customView id="iSp-bV-w6B" customClass="VLCBasicView">
<rect key="frame" x="0.0" y="0.0" width="598" height="138"/>
<customView misplaced="YES" id="iSp-bV-w6B" customClass="VLCBasicView">
<rect key="frame" x="0.0" y="0.0" width="598" height="134"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</customView>
<customView id="dus-WQ-AmE">
<rect key="frame" x="599" y="0.0" width="297" height="138"/>
<customView misplaced="YES" id="dus-WQ-AmE">
<rect key="frame" x="599" y="0.0" width="297" height="134"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TET-5r-zHx">
<rect key="frame" x="18" y="97" width="66" height="31"/>
<rect key="frame" x="18" y="92" width="66" height="31"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="fo5-R8-TeO">
<font key="font" textStyle="largeTitle" name=".SFNS-Regular"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
......@@ -44,7 +44,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mbV-My-cm7" customClass="VLCRoundedCornerTextField">
<rect key="frame" x="242" y="105" width="37" height="16"/>
<rect key="frame" x="242" y="100" width="37" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="4hq-fU-NXW">
<font key="font" metaFont="message"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
......@@ -52,12 +52,12 @@
</textFieldCell>
</textField>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="qmL-Ar-cj1">
<rect key="frame" x="20" y="87" width="257" height="5"/>
<rect key="frame" x="20" y="82" width="257" 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="63" width="297" height="18"/>
<rect key="frame" x="0.0" y="62" width="297" height="14"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Vdr-bg-tuS">
<rect key="frame" x="0.0" y="0.0" width="297" height="18"/>
<rect key="frame" x="0.0" y="0.0" width="297" height="14"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="Fr1-af-8gb" customClass="VLCPlaylistTableView">
......@@ -122,10 +122,10 @@
</scroller>
</scrollView>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="nAW-KH-ipk">
<rect key="frame" x="20" y="52" width="257" height="5"/>
<rect key="frame" x="20" y="51" width="257" height="5"/>
</box>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jg5-33-vH0">
<rect key="frame" x="20" y="15" width="24" height="24"/>
<rect key="frame" x="20" y="14" 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"/>
......@@ -135,7 +135,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8zF-Wo-H79">
<rect key="frame" x="64" y="15" width="24" height="24"/>
<rect key="frame" x="64" y="14" 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"/>
......@@ -145,7 +145,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cih-xp-HmY">
<rect key="frame" x="262" y="12" width="15.5" height="17"/>
<rect key="frame" x="262" y="11" width="15.5" height="17"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="trash" catalog="system" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="OjM-W9-IrQ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
......@@ -155,10 +155,10 @@
</connections>
</button>
<customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VFI-oW-dMZ" customClass="VLCDragDropView">
<rect key="frame" x="0.0" y="55" width="297" height="34"/>
<rect key="frame" x="0.0" y="54" width="297" height="30"/>
<subviews>
<box boxType="custom" borderType="line" borderWidth="0.0" cornerRadius="10" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="AXk-h7-dZ0">
<rect key="frame" x="81" y="-50" width="135" height="134"/>
<rect key="frame" x="81" y="-52" width="135" height="134"/>
<view key="contentView" id="NSp-cB-V4X">
<rect key="frame" x="0.0" y="0.0" width="135" height="134"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
......@@ -166,7 +166,7 @@
<color key="borderColor" name="separatorColor" catalog="System" colorSpace="catalog"/>
</box>
<imageView translatesAutoresizingMaskIntoConstraints="NO" id="cTV-Wf-TfJ" customClass="VLCDropDisabledImageView">
<rect key="frame" x="93" y="-39" width="112" height="112"/>
<rect key="frame" x="93" y="-41" width="112" height="112"/>
<constraints>
<constraint firstAttribute="width" constant="112" id="IvG-i0-rbs"/>
<constraint firstAttribute="height" constant="112" id="dO8-Iv-pDk"/>
......@@ -174,7 +174,7 @@
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="dropzone" id="sHO-XQ-hCU"/>
</imageView>
<button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SWh-4E-Qtf">
<rect key="frame" x="89" y="-87" width="119" height="32"/>
<rect key="frame" x="89" y="-89" width="119" height="32"/>
<buttonCell key="cell" type="push" title="Open media..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="UUH-HF-Iqc">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
......@@ -196,7 +196,7 @@
</constraints>
</customView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="244-FS-P3T">
<rect key="frame" x="236" y="15" width="16" height="10"/>
<rect key="frame" x="236" y="14" width="16" height="10"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="line.horizontal.3.decrease" catalog="system" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="qDZ-84-3uy">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
......@@ -794,6 +794,7 @@
<outlet property="songNameTextField" destination="d0e-29-yNq" id="JTI-XG-miC"/>
<outlet property="timeField" destination="zOB-QJ-TUy" id="mJL-1V-2lQ"/>
<outlet property="timeSlider" destination="9Hg-t2-K5z" id="sVe-s8-xW6"/>
<outlet property="trailingTimeField" destination="oGd-mG-cFw" id="geo-iq-0th"/>
<outlet property="volumeDownButton" destination="IAy-58-UPp" id="dDN-pE-Vmj"/>
<outlet property="volumeSlider" destination="noz-yJ-oH4" id="nbe-1c-lFH"/>
<outlet property="volumeUpButton" destination="75c-FF-mgb" id="xRz-F4-n0Z"/>
......
......@@ -30,6 +30,7 @@
* we need the implementation to catch our click-event in the controller window
*****************************************************************************/
extern NSString *VLCTimeFieldDisplayTimeAsElapsed;
extern NSString *VLCTimeFieldDisplayTimeAsRemaining;
@interface VLCTimeField : NSTextField
......
......@@ -28,6 +28,7 @@
#import "main/VLCMain.h"
#import "menus/VLCMainMenu.h"
NSString *VLCTimeFieldDisplayTimeAsElapsed = @"DisplayTimeAsTimeElapsed";
NSString *VLCTimeFieldDisplayTimeAsRemaining = @"DisplayTimeAsTimeRemaining";
@interface VLCTimeField ()
......
......@@ -54,6 +54,7 @@
@property (readwrite, strong) IBOutlet VLCWrappableTextField *songNameTextField;
@property (readwrite, strong) IBOutlet VLCWrappableTextField *artistNameTextField;
@property (readwrite, strong) IBOutlet VLCTimeField *timeField;
@property (readwrite, strong) IBOutlet VLCTimeField *trailingTimeField;
@property (readwrite, strong) IBOutlet NSButton *fullscreenButton;
@property (readwrite, strong) IBOutlet NSLayoutConstraint *fullscreenButtonWidthConstraint;
......
......@@ -140,13 +140,24 @@
[self updateTimeSlider:nil];
NSColor *timeFieldTextColor = [NSColor controlTextColor];
[self.timeField setTextColor: timeFieldTextColor];
[self.timeField setFont:[NSFont titleBarFontOfSize:10.0]];
[self.timeField setAlignment: NSCenterTextAlignment];
[self.timeField setNeedsDisplay:YES];
[self.timeField setRemainingIdentifier:VLCTimeFieldDisplayTimeAsRemaining];
[self.timeField setRemainingIdentifier:VLCTimeFieldDisplayTimeAsElapsed];
self.trailingTimeField.isTimeRemaining = NO;
self.timeField.accessibilityLabel = _NS("Playback time");
self.trailingTimeField.isTimeRemaining = !self.timeField.isTimeRemaining;
[self.trailingTimeField setTextColor: timeFieldTextColor];
[self.trailingTimeField setFont:[NSFont titleBarFontOfSize:10.0]];
[self.trailingTimeField setAlignment: NSCenterTextAlignment];
[self.trailingTimeField setNeedsDisplay:YES];
[self.trailingTimeField setRemainingIdentifier:VLCTimeFieldDisplayTimeAsRemaining];
self.trailingTimeField.isTimeRemaining = YES;
self.trailingTimeField.accessibilityLabel = _NS("Playback time");
// remove fullscreen button for lion fullscreen
if (_nativeFullscreenMode) {
self.fullscreenButtonWidthConstraint.constant = 0;
......@@ -387,6 +398,8 @@
negative:YES];
[self.timeField setTime:timeString withRemainingTime:remainingTime];
[self.timeField setNeedsDisplay:YES];
[self.trailingTimeField setTime:timeString withRemainingTime:remainingTime];
[self.trailingTimeField setNeedsDisplay:YES];
}
- (void)playerStateUpdated:(NSNotification *)aNotification
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment