From 5e33115229969a072e866d1ae23ec9cfcf331460 Mon Sep 17 00:00:00 2001 From: Marvin Scholz <epirat07@gmail.com> Date: Tue, 13 Dec 2016 11:15:43 +0100 Subject: [PATCH] macosx: Make VLCFSPanelController accessible This re-adds the accessibility strings that were present in the old fullscreen controller. --- .../English.lproj/VLCFullScreenPanel.xib | 5 ++- modules/gui/macosx/VLCFSPanelController.h | 1 + modules/gui/macosx/VLCFSPanelController.m | 40 +++++++++++++++++++ po/POTFILES.in | 2 + 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/extras/package/macosx/Resources/English.lproj/VLCFullScreenPanel.xib b/extras/package/macosx/Resources/English.lproj/VLCFullScreenPanel.xib index 54df10055837..f9f542372c6a 100644 --- a/extras/package/macosx/Resources/English.lproj/VLCFullScreenPanel.xib +++ b/extras/package/macosx/Resources/English.lproj/VLCFullScreenPanel.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16A323" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11761" systemVersion="16B2657" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <dependencies> <deployment identifier="macosx"/> <development version="7000" identifier="xcode"/> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11761"/> <capability name="Aspect ratio constraints" minToolsVersion="5.1"/> <capability name="system font weights other than Regular or Bold" minToolsVersion="7.0"/> </dependencies> @@ -14,6 +14,7 @@ <outlet property="controlsView" destination="Npt-C5-K77" id="Dnt-ku-O6u"/> <outlet property="elapsedTime" destination="nJc-M4-sMF" id="DFf-yw-e6A"/> <outlet property="forwardButton" destination="jSN-hV-r5D" id="3PN-jP-xPY"/> + <outlet property="fullscreenButton" destination="C5K-aX-3aJ" id="AGc-uy-2b0"/> <outlet property="heightMaxConstraint" destination="Vwe-uz-fKC" id="yz0-Rh-MKt"/> <outlet property="mediaTitle" destination="Vd8-0f-Usz" id="NZ0-KY-l4T"/> <outlet property="nextButton" destination="2ai-dB-Wpq" id="Axl-RO-LfI"/> diff --git a/modules/gui/macosx/VLCFSPanelController.h b/modules/gui/macosx/VLCFSPanelController.h index 670b49abb76d..90f97285bbff 100644 --- a/modules/gui/macosx/VLCFSPanelController.h +++ b/modules/gui/macosx/VLCFSPanelController.h @@ -40,6 +40,7 @@ @property IBOutlet NSButton *backwardButton; @property IBOutlet NSButton *nextButton; @property IBOutlet NSButton *previousButton; +@property IBOutlet NSButton *fullscreenButton; @property IBOutlet NSTextField *mediaTitle; @property IBOutlet VLCTimeField *elapsedTime; @property IBOutlet VLCTimeField *remainingOrTotalTime; diff --git a/modules/gui/macosx/VLCFSPanelController.m b/modules/gui/macosx/VLCFSPanelController.m index 35f149e2c19e..818ee3156584 100644 --- a/modules/gui/macosx/VLCFSPanelController.m +++ b/modules/gui/macosx/VLCFSPanelController.m @@ -71,9 +71,49 @@ [self injectBackgroundView]; #endif + /* TODO: Write custom Image-only button subclass to behave properly */ [(NSButtonCell*)[_playPauseButton cell] setHighlightsBy:NSPushInCellMask]; [(NSButtonCell*)[_playPauseButton cell] setShowsStateBy:NSContentsCellMask]; + [self setupControls]; +} + +#define setupButton(target, title, desc) \ + [target accessibilitySetOverrideValue:title \ + forAttribute:NSAccessibilityTitleAttribute]; \ + [target accessibilitySetOverrideValue:desc \ + forAttribute:NSAccessibilityDescriptionAttribute]; \ + [target setToolTip:desc]; + +- (void)setupControls +{ + /* Setup translations for buttons */ + setupButton(_playPauseButton, + _NS("Play/Pause"), + _NS("Click to play or pause the current media.")); + setupButton(_nextButton, + _NS("Next"), + _NS("Click to go to the next playlist item.")); + setupButton(_previousButton, + _NS("Previous"), + _NS("Click to go to the previous playlist item.")); + setupButton(_forwardButton, + _NS("Forward"), + _NS("Click and hold to skip forward through the current media.")); + setupButton(_backwardButton, + _NS("Backward"), + _NS("Click and hold to skip backward through the current media.")); + setupButton(_fullscreenButton, + _NS("Toggle Fullscreen mode"), + _NS("Click to exit fullscreen playback.")); + setupButton(_volumeSlider, + _NS("Volume"), + _NS("Drag to adjust the volume.")); + setupButton(_timeSlider, + _NS("Position"), + _NS("Drag to adjust the current playback position.")); + + /* Setup other controls */ [_volumeSlider setMaxValue:[[VLCCoreInteraction sharedInstance] maxVolume]]; [_volumeSlider setIntValue:AOUT_VOLUME_DEFAULT]; } diff --git a/po/POTFILES.in b/po/POTFILES.in index 2aec3e602c7e..cc3daca8dc2f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -556,6 +556,8 @@ modules/gui/macosx/VLCExtensionsDialogProvider.h modules/gui/macosx/VLCExtensionsDialogProvider.m modules/gui/macosx/VLCExtensionsManager.h modules/gui/macosx/VLCExtensionsManager.m +modules/gui/macosx/VLCFSPanelController.h +modules/gui/macosx/VLCFSPanelController.m modules/gui/macosx/helpers.h modules/gui/macosx/macosx.m modules/gui/macosx/VLCMain.h -- GitLab