[vlc-commits] macosx: Replace volume slider with VLCDefaultValueSlider
Marvin Scholz
git at videolan.org
Tue Jul 25 02:57:39 CEST 2017
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Jul 25 02:36:23 2017 +0200| [7265fc06edc25be7035350e07c8683bcc0854cd6] | committer: Marvin Scholz
macosx: Replace volume slider with VLCDefaultValueSlider
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7265fc06edc25be7035350e07c8683bcc0854cd6
---
modules/gui/macosx/UI/MainWindow.xib | 35 +++++++--------------------
modules/gui/macosx/VLCDefaultValueSlider.h | 2 ++
modules/gui/macosx/VLCDefaultValueSlider.m | 5 ++++
modules/gui/macosx/VLCMainWindowControlsBar.h | 4 +--
modules/gui/macosx/VLCMainWindowControlsBar.m | 3 +--
5 files changed, 19 insertions(+), 30 deletions(-)
diff --git a/modules/gui/macosx/UI/MainWindow.xib b/modules/gui/macosx/UI/MainWindow.xib
index 17367f905a..7f157e4498 100644
--- a/modules/gui/macosx/UI/MainWindow.xib
+++ b/modules/gui/macosx/UI/MainWindow.xib
@@ -611,7 +611,7 @@
</textFieldCell>
</textField>
<button translatesAutoresizingMaskIntoConstraints="NO" id="3653">
- <rect key="frame" x="570" y="13" width="5" height="11"/>
+ <rect key="frame" x="570" y="12" width="5" height="11"/>
<constraints>
<constraint firstAttribute="height" constant="11" id="fR7-Fz-iWX"/>
</constraints>
@@ -623,34 +623,22 @@
<action selector="volumeAction:" target="5339" id="5361"/>
</connections>
</button>
- <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3649" customClass="ITSlider">
- <rect key="frame" x="578" y="11" width="48" height="15"/>
+ <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3649" customClass="VLCDefaultValueSlider">
+ <rect key="frame" x="578" y="11" width="48" height="13"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="48" id="XRa-UG-wuM"/>
+ </constraints>
<ciFilter key="compositingFilter" name="CISourceOverCompositing">
<configuration>
<null key="inputBackgroundImage"/>
<null key="inputImage"/>
</configuration>
</ciFilter>
- <sliderCell key="cell" controlSize="small" continuous="YES" alignment="left" maxValue="512" doubleValue="251.95348837209303" tickMarkPosition="above" sliderType="linear" id="4276" customClass="VolumeSliderCell">
- <font key="font" size="12" name="Helvetica"/>
- </sliderCell>
+ <sliderCell key="cell" controlSize="mini" continuous="YES" alignment="left" maxValue="512" doubleValue="251.95348837209303" tickMarkPosition="above" sliderType="linear" id="4276"/>
<connections>
<action selector="volumeAction:" target="5339" id="5358"/>
</connections>
</slider>
- <imageView translatesAutoresizingMaskIntoConstraints="NO" id="4417">
- <rect key="frame" x="578" y="16" width="48" height="5"/>
- <constraints>
- <constraint firstAttribute="height" constant="5" id="Xxv-t7-alW"/>
- </constraints>
- <ciFilter key="compositingFilter" name="CISourceOverCompositing">
- <configuration>
- <null key="inputBackgroundImage"/>
- <null key="inputImage"/>
- </configuration>
- </ciFilter>
- <imageCell key="cell" refusesFirstResponder="YES" alignment="left" image="volume-slider-track" id="4418"/>
- </imageView>
<button translatesAutoresizingMaskIntoConstraints="NO" id="3652">
<rect key="frame" x="629" y="12" width="13" height="11"/>
<constraints>
@@ -728,21 +716,18 @@
</slider>
</subviews>
<constraints>
- <constraint firstItem="3653" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="5K8-hV-nOQ"/>
<constraint firstItem="mrr-Bw-co0" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="5tM-K0-mjZ"/>
<constraint firstItem="3652" firstAttribute="leading" secondItem="3649" secondAttribute="trailing" constant="3" id="Apb-gM-P9J"/>
<constraint firstItem="4423" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="HUU-wF-duH"/>
<constraint firstItem="jlp-Z2-Qdl" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="Hnv-b4-wWi"/>
<constraint firstItem="dff-fl-Mde" firstAttribute="leading" secondItem="3652" secondAttribute="trailing" constant="8" symbolic="YES" id="TVP-Cr-bfO"/>
- <constraint firstItem="4417" firstAttribute="trailing" secondItem="3649" secondAttribute="trailing" id="WUo-ur-GGy"/>
<constraint firstItem="3647" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="WdH-6H-Xhc"/>
+ <constraint firstItem="3653" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="WjR-sa-lQq"/>
<constraint firstItem="4423" firstAttribute="leading" secondItem="4422" secondAttribute="trailing" constant="8" id="YpP-Vj-f9b"/>
<constraint firstItem="4422" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="Zit-b0-8jR"/>
- <constraint firstItem="4417" firstAttribute="leading" secondItem="3649" secondAttribute="leading" id="b86-zP-VqN"/>
- <constraint firstItem="4417" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="gI8-2E-JGT"/>
+ <constraint firstItem="3652" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="cci-dm-60V"/>
<constraint firstItem="dff-fl-Mde" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="gqZ-nc-67e"/>
<constraint firstItem="3649" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="ll4-Gr-Hs6"/>
- <constraint firstItem="3652" firstAttribute="centerY" secondItem="5608" secondAttribute="centerY" id="o7m-oP-mfd"/>
<constraint firstItem="jlp-Z2-Qdl" firstAttribute="leading" secondItem="5608" secondAttribute="leading" constant="8" id="odn-Ek-4d1"/>
<constraint firstItem="4422" firstAttribute="leading" secondItem="mrr-Bw-co0" secondAttribute="trailing" constant="8" id="tg9-ZJ-h8u"/>
<constraint firstItem="3653" firstAttribute="leading" secondItem="4423" secondAttribute="trailing" constant="8" symbolic="YES" id="tn5-dP-NYa"/>
@@ -840,7 +825,6 @@
<outlet property="timeSlider" destination="4422" id="I3H-rQ-4GH"/>
<outlet property="volumeDownButton" destination="3653" id="brO-P5-sUM"/>
<outlet property="volumeSlider" destination="3649" id="NDW-el-poL"/>
- <outlet property="volumeTrackImageView" destination="4417" id="xH3-Dg-2Ok"/>
<outlet property="volumeUpButton" destination="3652" id="vXR-KC-L2N"/>
</connections>
</customObject>
@@ -1040,6 +1024,5 @@ Gw
<image name="topbar_background" width="1" height="27"/>
<image name="volume-high" width="13" height="11"/>
<image name="volume-low" width="5" height="10"/>
- <image name="volume-slider-track" width="48" height="5"/>
</resources>
</document>
diff --git a/modules/gui/macosx/VLCDefaultValueSlider.h b/modules/gui/macosx/VLCDefaultValueSlider.h
index ebb22f0f64..6b946157d0 100644
--- a/modules/gui/macosx/VLCDefaultValueSlider.h
+++ b/modules/gui/macosx/VLCDefaultValueSlider.h
@@ -53,4 +53,6 @@
*/
- (double)defaultValue;
+- (void)setUsesBrightArtwork:(BOOL)brightArtwork;
+
@end
diff --git a/modules/gui/macosx/VLCDefaultValueSlider.m b/modules/gui/macosx/VLCDefaultValueSlider.m
index aecb590cbc..1de71872b3 100644
--- a/modules/gui/macosx/VLCDefaultValueSlider.m
+++ b/modules/gui/macosx/VLCDefaultValueSlider.m
@@ -75,4 +75,9 @@
return [(VLCDefaultValueSliderCell *)self.cell defaultValue];
}
+- (void)setUsesBrightArtwork:(BOOL)brightArtwork
+{
+ // TODO!
+}
+
@end
diff --git a/modules/gui/macosx/VLCMainWindowControlsBar.h b/modules/gui/macosx/VLCMainWindowControlsBar.h
index 5010c50e7b..7a16c16732 100644
--- a/modules/gui/macosx/VLCMainWindowControlsBar.h
+++ b/modules/gui/macosx/VLCMainWindowControlsBar.h
@@ -25,6 +25,7 @@
#import <Cocoa/Cocoa.h>
#import "misc.h"
#import "VLCControlsBarCommon.h"
+#import "VLCDefaultValueSlider.h"
/*****************************************************************************
* VLCMainWindowControlsBar
@@ -48,8 +49,7 @@
@property (readwrite, strong) IBOutlet NSButton *shuffleButton;
@property (readwrite, strong) IBOutlet NSLayoutConstraint *shuffleButtonWidthConstraint;
- at property (readwrite, strong) IBOutlet VLCVolumeSliderCommon * volumeSlider;
- at property (readwrite, strong) IBOutlet NSImageView *volumeTrackImageView;
+ at property (readwrite, strong) IBOutlet VLCDefaultValueSlider *volumeSlider;
@property (readwrite, strong) IBOutlet NSButton *volumeDownButton;
@property (readwrite, strong) IBOutlet NSButton *volumeUpButton;
diff --git a/modules/gui/macosx/VLCMainWindowControlsBar.m b/modules/gui/macosx/VLCMainWindowControlsBar.m
index 8a9d70676a..d4467e3f16 100644
--- a/modules/gui/macosx/VLCMainWindowControlsBar.m
+++ b/modules/gui/macosx/VLCMainWindowControlsBar.m
@@ -114,7 +114,6 @@
_pressedShuffleOnImage = imageFromRes(@"shuffle-blue-pressed");
[self.volumeDownButton setImage: imageFromRes(@"volume-low")];
- [self.volumeTrackImageView setImage: imageFromRes(@"volume-slider-track")];
[self.volumeUpButton setImage: imageFromRes(@"volume-high")];
[self.volumeSlider setUsesBrightArtwork: YES];
@@ -151,7 +150,6 @@
_pressedShuffleOnImage = imageFromRes(@"shuffle-blue-pressed_dark");
[self.volumeDownButton setImage: imageFromRes(@"volume-low_dark")];
- [self.volumeTrackImageView setImage: imageFromRes(@"volume-slider-track_dark")];
[self.volumeUpButton setImage: imageFromRes(@"volume-high_dark")];
[self.volumeSlider setUsesBrightArtwork: NO];
@@ -179,6 +177,7 @@
BOOL b_mute = ![[VLCCoreInteraction sharedInstance] mute];
[self.volumeSlider setEnabled: b_mute];
[self.volumeSlider setMaxValue: [[VLCCoreInteraction sharedInstance] maxVolume]];
+ [self.volumeSlider setDefaultValue: AOUT_VOLUME_DEFAULT];
[self.volumeUpButton setEnabled: b_mute];
// configure optional buttons
More information about the vlc-commits
mailing list