macosx: Replace volume slider with VLCDefaultValueSlider
authorMarvin Scholz <epirat07@gmail.com>
Tue, 25 Jul 2017 00:36:23 +0000 (02:36 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Tue, 25 Jul 2017 00:55:20 +0000 (02:55 +0200)
modules/gui/macosx/UI/MainWindow.xib
modules/gui/macosx/VLCDefaultValueSlider.h
modules/gui/macosx/VLCDefaultValueSlider.m
modules/gui/macosx/VLCMainWindowControlsBar.h
modules/gui/macosx/VLCMainWindowControlsBar.m

index 17367f9..7f157e4 100644 (file)
                                         </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>
                                             <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>
                                     </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"/>
                 <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>
index ebb22f0..6b94615 100644 (file)
@@ -53,4 +53,6 @@
  */
 - (double)defaultValue;
 
+- (void)setUsesBrightArtwork:(BOOL)brightArtwork;
+
 @end
index aecb590..1de7187 100644 (file)
@@ -75,4 +75,9 @@
     return [(VLCDefaultValueSliderCell *)self.cell defaultValue];
 }
 
+- (void)setUsesBrightArtwork:(BOOL)brightArtwork
+{
+    // TODO!
+}
+
 @end
index 5010c50..7a16c16 100644 (file)
@@ -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;
 
-@property (readwrite, strong) IBOutlet VLCVolumeSliderCommon * volumeSlider;
-@property (readwrite, strong) IBOutlet NSImageView *volumeTrackImageView;
+@property (readwrite, strong) IBOutlet VLCDefaultValueSlider *volumeSlider;
 @property (readwrite, strong) IBOutlet NSButton *volumeDownButton;
 @property (readwrite, strong) IBOutlet NSButton *volumeUpButton;
 
index 8a9d706..d4467e3 100644 (file)
         _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];
 
         _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];
 
     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