Browse Source

macosx: Move mute volume button outlet to VLCControlsBarCommon

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/144/head
Claudio Cambra 4 years ago
committed by Jean-Baptiste Kempf
parent
commit
7e18c3ff97
  1. 2
      modules/gui/macosx/UI/VLCLibraryWindow.xib
  2. 4
      modules/gui/macosx/UI/VLCMainVideoView.xib
  3. 1
      modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.h
  4. 6
      modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
  5. 1
      modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h
  6. 8
      modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m

2
modules/gui/macosx/UI/VLCLibraryWindow.xib

@ -834,7 +834,7 @@
<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="muteVolumeButton" 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"/>
</connections>

4
modules/gui/macosx/UI/VLCMainVideoView.xib

@ -28,6 +28,7 @@
<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"/>
<outlet property="muteVolumeButton" destination="tVB-Xs-sJJ" id="snj-OU-aTI"/>
<outlet property="playButton" destination="PCC-8a-sVF" id="ddT-ZM-Jhz"/>
<outlet property="songNameTextField" destination="lEW-MN-FFU" id="btX-L9-7TO"/>
<outlet property="timeField" destination="3ri-8b-8mw" id="f0i-Gh-R8V"/>
@ -128,6 +129,9 @@
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="volumeAction:" target="3" id="4W0-Ft-7pO"/>
</connections>
</button>
<slider verticalHuggingPriority="750" horizontalCompressionResistancePriority="800" translatesAutoresizingMaskIntoConstraints="NO" id="lyY-Zo-4aH" customClass="VLCVolumeSlider">
<rect key="frame" x="27" y="4" width="84" height="17"/>

1
modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.h

@ -50,6 +50,7 @@
@property (readwrite, strong) IBOutlet VLCSlider *timeSlider;
@property (readwrite, strong) IBOutlet VLCVolumeSlider *volumeSlider;
@property (readwrite, strong) IBOutlet NSButton *muteVolumeButton;
@property (readwrite, strong) IBOutlet VLCImageView *artworkImageView;
@property (readwrite, strong) IBOutlet NSButton *artworkButton;

6
modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m

@ -156,6 +156,10 @@
[self.volumeSlider setDefaultValue: VLCVolumeDefault];
[self updateVolumeSlider:nil];
[self.muteVolumeButton setToolTip: _NS("Mute")];
self.muteVolumeButton.accessibilityLabel = self.muteVolumeButton.toolTip;
[self.muteVolumeButton setImage: imageFromRes(@"volume-low")];
NSColor *timeFieldTextColor = [NSColor controlTextColor];
[self.timeField setTextColor: timeFieldTextColor];
@ -330,6 +334,8 @@
{
if (sender == self.volumeSlider) {
[_playerController setVolume:[sender floatValue]];
} else if (sender == self.muteVolumeButton) {
[_playerController toggleMute];
}
}

1
modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h

@ -43,7 +43,6 @@
@property (readwrite, strong) IBOutlet NSLayoutConstraint *artistNameTextFieldWidthConstraint;
@property (readwrite, strong) IBOutlet NSTextField *songArtistSeparatorTextField;
@property (readwrite, strong) IBOutlet NSButton *volumeDownButton;
@property (readwrite, strong) IBOutlet NSButton *volumeUpButton;
- (IBAction)stop:(id)sender;

8
modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m

@ -66,16 +66,12 @@
[self.stopButton setToolTip: _NS("Stop")];
self.stopButton.accessibilityLabel = self.stopButton.toolTip;
[self.volumeDownButton setToolTip: _NS("Mute")];
self.volumeDownButton.accessibilityLabel = self.volumeDownButton.toolTip;
[self.volumeUpButton setToolTip: _NS("Full Volume")];
self.volumeUpButton.accessibilityLabel = self.volumeUpButton.toolTip;
[self.stopButton setImage: imageFromRes(@"stop")];
[self.stopButton setAlternateImage: imageFromRes(@"stop-pressed")];
[self.volumeDownButton setImage: imageFromRes(@"volume-low")];
[self.volumeUpButton setImage: imageFromRes(@"volume-high")];
[self.fullscreenButton setImage: imageFromRes(@"VLCFullscreenOffTemplate")];
@ -114,9 +110,7 @@
- (IBAction)volumeAction:(id)sender
{
if (sender == self.volumeDownButton) {
[_playerController toggleMute];
} else if (sender == self.volumeUpButton) {
if (sender == self.volumeUpButton) {
[_playerController setVolume:VLCVolumeMaximum];
} else {
[super volumeAction:sender];

Loading…
Cancel
Save