[vlc-commits] macosx: time slider cosmetics
Felix Paul Kühne
git at videolan.org
Fri Sep 13 18:26:55 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Fri Sep 13 17:38:17 2019 +0200| [1a14df6b52fc1dc23f7137ba04f3db7ea43d1b30] | committer: Felix Paul Kühne
macosx: time slider cosmetics
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a14df6b52fc1dc23f7137ba04f3db7ea43d1b30
---
modules/gui/macosx/UI/DetachedVideoWindow.xib | 16 ++++++++--------
modules/gui/macosx/UI/VLCLibraryWindow.xib | 8 ++++----
.../gui/macosx/windows/mainwindow/VLCControlsBarCommon.m | 16 +++++++++-------
3 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/modules/gui/macosx/UI/DetachedVideoWindow.xib b/modules/gui/macosx/UI/DetachedVideoWindow.xib
index ef425297b6..d5cde479c5 100644
--- a/modules/gui/macosx/UI/DetachedVideoWindow.xib
+++ b/modules/gui/macosx/UI/DetachedVideoWindow.xib
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -13,11 +13,11 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
- <window title="VLC media player" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="detachedvideowindow" animationBehavior="default" id="2" userLabel="Detached Video Window" customClass="VLCDetachedVideoWindow">
+ <window title="VLC media player" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="detachedvideowindow" animationBehavior="default" id="2" userLabel="Detached Video Window" customClass="VLCDetachedVideoWindow">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" topStrut="YES"/>
<rect key="contentRect" x="91" y="467" width="363" height="239"/>
- <rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
+ <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
<view key="contentView" id="4">
<rect key="frame" x="0.0" y="0.0" width="363" height="239"/>
<autoresizingMask key="autoresizingMask"/>
@@ -29,7 +29,7 @@
<rect key="frame" x="0.0" y="0.0" width="363" height="36"/>
<subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Vae-cT-EEI" userLabel="Play controls group">
- <rect key="frame" x="8" y="6" width="85" height="23"/>
+ <rect key="frame" x="8" y="7" width="85" height="23"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="11">
<rect key="frame" x="0.0" y="0.0" width="29" height="23"/>
@@ -81,7 +81,7 @@
<constraints>
<constraint firstAttribute="height" constant="14" id="MYp-CS-yPe"/>
</constraints>
- <sliderCell key="cell" controlSize="small" continuous="YES" state="on" alignment="left" maxValue="10000" doubleValue="3260.3068524096384" tickMarkPosition="above" sliderType="linear" id="23" customClass="VLCSliderCell">
+ <sliderCell key="cell" controlSize="small" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.32600000000000001" tickMarkPosition="above" sliderType="linear" id="23" customClass="VLCSliderCell">
<font key="font" size="12" name="Helvetica"/>
</sliderCell>
<connections>
@@ -89,7 +89,7 @@
</connections>
</slider>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9" customClass="VLCTimeField">
- <rect key="frame" x="264" y="11" width="56" height="13"/>
+ <rect key="frame" x="264" y="12" width="56" height="13"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="52" id="EvZ-Sy-m25"/>
<constraint firstAttribute="height" constant="13" id="LYT-Sd-Gf6"/>
@@ -101,7 +101,7 @@
</textFieldCell>
</textField>
<button translatesAutoresizingMaskIntoConstraints="NO" id="8">
- <rect key="frame" x="326" y="6" width="29" height="23"/>
+ <rect key="frame" x="326" y="7" width="29" height="23"/>
<constraints>
<constraint firstAttribute="width" constant="29" id="VjW-79-ABX"/>
<constraint firstAttribute="height" constant="23" id="fNg-pN-oQw"/>
diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib b/modules/gui/macosx/UI/VLCLibraryWindow.xib
index 81ccac84fe..202c305c39 100644
--- a/modules/gui/macosx/UI/VLCLibraryWindow.xib
+++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib
@@ -23,7 +23,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="W1M-0o-qYG">
- <rect key="frame" x="212" y="333" width="56" height="23"/>
+ <rect key="frame" x="212.5" y="333" width="56" height="23"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedRounded" trackingMode="selectOne" id="Twg-gp-8ng">
<font key="font" metaFont="system"/>
<segments>
@@ -295,7 +295,7 @@
<constraints>
<constraint firstAttribute="height" constant="14" id="4YR-vo-ZfK"/>
</constraints>
- <sliderCell key="cell" controlSize="small" continuous="YES" state="on" alignment="left" maxValue="10000" doubleValue="3260.3068524096384" tickMarkPosition="above" sliderType="linear" id="YMg-uo-8nX" customClass="VLCSliderCell">
+ <sliderCell key="cell" controlSize="small" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.32600000000000001" tickMarkPosition="above" sliderType="linear" id="YMg-uo-8nX" customClass="VLCSliderCell">
<font key="font" size="12" name="Helvetica"/>
</sliderCell>
<connections>
@@ -570,7 +570,7 @@
<rect key="frame" x="0.0" y="498" width="242" height="310"/>
<clipView key="contentView" copiesOnScroll="NO" id="J5s-sy-il6">
<rect key="frame" x="0.0" y="0.0" width="242" height="310"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <autoresizingMask key="autoresizingMask"/>
<subviews>
<collectionView selectable="YES" id="hnE-Hj-MZo">
<rect key="frame" x="0.0" y="0.0" width="242" height="310"/>
@@ -600,7 +600,7 @@
<rect key="frame" x="0.0" y="0.0" width="242" height="498"/>
<clipView key="contentView" copiesOnScroll="NO" id="OKa-dt-1yY">
<rect key="frame" x="0.0" y="0.0" width="242" height="498"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <autoresizingMask key="autoresizingMask"/>
<subviews>
<collectionView selectable="YES" id="B8x-e8-7zp">
<rect key="frame" x="0.0" y="0.0" width="242" height="498"/>
diff --git a/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m b/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
index de64eb5fb6..bd2c1fa2cc 100644
--- a/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
+++ b/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
@@ -228,9 +228,11 @@
- (IBAction)timeSliderAction:(id)sender
{
- float f_updatedDelta;
+ float newPosition;
+ NSEvent *theEvent = [NSApp currentEvent];
+ NSEventType theEventType = [theEvent type];
- switch([[NSApp currentEvent] type]) {
+ switch (theEventType) {
case NSLeftMouseUp:
/* Ignore mouse up, as this is a continous slider and
* when the user does a single click to a position on the slider,
@@ -242,18 +244,18 @@
return;
case NSLeftMouseDown:
case NSLeftMouseDragged:
- f_updatedDelta = [sender floatValue];
+ newPosition = [sender floatValue];
break;
case NSScrollWheel:
- f_updatedDelta = [sender floatValue];
+ newPosition = [sender floatValue];
break;
default:
return;
}
- [_playerController setPositionFast:f_updatedDelta / 10000.];
- [self.timeSlider setFloatValue:f_updatedDelta];
+ [_playerController setPositionFast:newPosition];
+ [self.timeSlider setFloatValue:newPosition];
}
- (IBAction)fullscreen:(id)sender
@@ -279,7 +281,7 @@
}
[self.timeSlider setKnobHidden:NO];
- [self.timeSlider setFloatValue:(10000. * _playerController.position)];
+ [self.timeSlider setFloatValue:_playerController.position];
vlc_tick_t duration = inputItem.duration;
bool buffering = _playerController.playerState == VLC_PLAYER_STATE_STARTED;
More information about the vlc-commits
mailing list