[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx: Add a video settings button to main video view XIB

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Sep 16 08:56:40 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7d0af1db by Claudio Cambra at 2024-09-16T08:31:21+00:00
macosx: Add a video settings button to main video view XIB

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
89fd2409 by Claudio Cambra at 2024-09-16T08:31:21+00:00
macosx: Add openVideoMenu method to video view controls bar

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
64a065af by Claudio Cambra at 2024-09-16T08:31:21+00:00
macosx: Set up tooltip and accessibility string on video menu button in video view controls bar

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
b4c0be7d by Claudio Cambra at 2024-09-16T08:31:21+00:00
macosx: Connect video menu button to relevant outlets and actions in main video view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


3 changed files:

- modules/gui/macosx/UI/VLCMainVideoView.xib
- modules/gui/macosx/windows/controlsbar/VLCMainVideoViewControlsBar.h
- modules/gui/macosx/windows/controlsbar/VLCMainVideoViewControlsBar.m


Changes:

=====================================
modules/gui/macosx/UI/VLCMainVideoView.xib
=====================================
@@ -50,6 +50,7 @@
                 <outlet property="timeField" destination="3ri-8b-8mw" id="f0i-Gh-R8V"/>
                 <outlet property="timeSlider" destination="qNZ-Fh-W8i" id="Fkk-fj-s5Q"/>
                 <outlet property="trailingTimeField" destination="f4v-2z-dQ1" id="AXX-AU-lF0"/>
+                <outlet property="videoButton" destination="95O-Oc-zrQ" id="7KZ-ye-fSx"/>
                 <outlet property="volumeSlider" destination="fKc-2d-Uu6" id="2pU-fH-Afo"/>
             </connections>
         </customObject>
@@ -116,10 +117,10 @@
                                         </textFieldCell>
                                     </textField>
                                     <stackView distribution="fill" orientation="vertical" alignment="leading" spacing="4" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="San-L7-ZvB">
-                                        <rect key="frame" x="20" y="59" width="316" height="53"/>
+                                        <rect key="frame" x="20" y="59" width="279" height="53"/>
                                         <subviews>
                                             <textField wantsLayer="YES" focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="lEW-MN-FFU" customClass="VLCWrappableTextField">
-                                                <rect key="frame" x="-2" y="25" width="320" height="28"/>
+                                                <rect key="frame" x="-2" y="25" width="283" height="28"/>
                                                 <textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" placeholderString="Nothing Playing" usesSingleLineMode="YES" id="8l0-zS-fOa">
                                                     <font key="font" metaFont="systemBold" size="24"/>
                                                     <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -159,13 +160,28 @@
                                         </connections>
                                     </slider>
                                     <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="10" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sJu-ZK-5QH">
-                                        <rect key="frame" x="356" y="59" width="344" height="32"/>
+                                        <rect key="frame" x="319" y="59" width="381" height="32"/>
                                         <subviews>
                                             <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Y8F-hr-iaW">
-                                                <rect key="frame" x="0.0" y="0.0" width="217" height="32"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="254" height="32"/>
                                                 <subviews>
-                                                    <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cja-ZG-8LF" customClass="VLCImageButton">
+                                                    <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="95O-Oc-zrQ" customClass="VLCImageButton">
                                                         <rect key="frame" x="0.0" y="-1" width="32" height="33"/>
+                                                        <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="photo.tv" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="dnH-S4-sBc">
+                                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
+                                                            <font key="font" metaFont="system"/>
+                                                        </buttonCell>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" secondItem="95O-Oc-zrQ" secondAttribute="height" multiplier="1:1" id="jod-n4-Mmj"/>
+                                                            <constraint firstAttribute="width" secondItem="95O-Oc-zrQ" secondAttribute="height" multiplier="1:1" id="mpK-z1-1hE"/>
+                                                            <constraint firstAttribute="width" constant="32" id="u03-Cv-8L6"/>
+                                                        </constraints>
+                                                        <connections>
+                                                            <action selector="openVideoMenu:" target="3" id="pOh-qk-4IK"/>
+                                                        </connections>
+                                                    </button>
+                                                    <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cja-ZG-8LF" customClass="VLCImageButton">
+                                                        <rect key="frame" x="37" y="-1" width="32" height="33"/>
                                                         <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="waveform.circle" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="5em-Cm-yoF">
                                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                                                             <font key="font" metaFont="system"/>
@@ -179,7 +195,7 @@
                                                         </connections>
                                                     </button>
                                                     <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YTl-LZ-WDe" customClass="VLCImageButton">
-                                                        <rect key="frame" x="37" y="-1" width="32" height="33"/>
+                                                        <rect key="frame" x="74" y="-1" width="32" height="33"/>
                                                         <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="text.bubble" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="1qF-LY-LkO">
                                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                                                             <font key="font" metaFont="system"/>
@@ -194,7 +210,7 @@
                                                         </connections>
                                                     </button>
                                                     <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4tZ-52-1q9" customClass="VLCImageButton">
-                                                        <rect key="frame" x="74" y="-1" width="32" height="33"/>
+                                                        <rect key="frame" x="111" y="-1" width="32" height="33"/>
                                                         <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="bookmark.circle" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="bGc-fn-jgQ">
                                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                                                             <font key="font" metaFont="system"/>
@@ -209,7 +225,7 @@
                                                         </connections>
                                                     </button>
                                                     <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8jZ-hd-YVq" customClass="VLCImageButton">
-                                                        <rect key="frame" x="111" y="-1" width="32" height="33"/>
+                                                        <rect key="frame" x="148" y="-1" width="32" height="33"/>
                                                         <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="play.rectangle.on.rectangle.fill" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="fyV-F5-ogO">
                                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                                                             <font key="font" metaFont="system"/>
@@ -223,7 +239,7 @@
                                                         </connections>
                                                     </button>
                                                     <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dYZ-ri-Kra" customClass="VLCImageButton">
-                                                        <rect key="frame" x="148" y="-1" width="32" height="33"/>
+                                                        <rect key="frame" x="185" y="-1" width="32" height="33"/>
                                                         <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="arrow.up.left.and.arrow.down.right" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="Z8g-js-0W6">
                                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                                                             <font key="font" metaFont="system"/>
@@ -237,7 +253,7 @@
                                                         </connections>
                                                     </button>
                                                     <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yEi-SZ-SIS" customClass="VLCImageButton">
-                                                        <rect key="frame" x="185" y="-1" width="32" height="33"/>
+                                                        <rect key="frame" x="222" y="-1" width="32" height="33"/>
                                                         <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="pip.enter" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="Q7p-GS-7p0">
                                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
                                                             <font key="font" metaFont="system"/>
@@ -258,6 +274,7 @@
                                                     <integer value="1000"/>
                                                     <integer value="1000"/>
                                                     <integer value="1000"/>
+                                                    <integer value="1000"/>
                                                 </visibilityPriorities>
                                                 <customSpacing>
                                                     <real value="3.4028234663852886e+38"/>
@@ -266,10 +283,11 @@
                                                     <real value="3.4028234663852886e+38"/>
                                                     <real value="3.4028234663852886e+38"/>
                                                     <real value="3.4028234663852886e+38"/>
+                                                    <real value="3.4028234663852886e+38"/>
                                                 </customSpacing>
                                             </stackView>
                                             <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zyp-45-IgR">
-                                                <rect key="frame" x="227" y="0.0" width="117" height="32"/>
+                                                <rect key="frame" x="264" y="0.0" width="117" height="32"/>
                                                 <subviews>
                                                     <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="afi-4d-rQk" customClass="VLCImageButton">
                                                         <rect key="frame" x="0.0" y="-1" width="32" height="33"/>
@@ -500,10 +518,11 @@
         <image name="backward.fill" catalog="system" width="19" height="12"/>
         <image name="bookmark.circle" catalog="system" width="15" height="15"/>
         <image name="forward.fill" catalog="system" width="19" height="12"/>
+        <image name="photo.tv" catalog="system" width="19" height="15"/>
         <image name="pin.fill" catalog="system" width="19" height="22"/>
         <image name="pip.enter" catalog="system" width="20" height="16"/>
         <image name="play.fill" catalog="system" width="12" height="13"/>
-        <image name="play.rectangle.on.rectangle.fill" catalog="system" width="19" height="15"/>
+        <image name="play.rectangle.on.rectangle.fill" catalog="system" width="19" height="16"/>
         <image name="text.bubble" catalog="system" width="17" height="16"/>
         <image name="volume.3.fill" catalog="system" width="22" height="15"/>
         <image name="waveform.circle" catalog="system" width="15" height="15"/>


=====================================
modules/gui/macosx/windows/controlsbar/VLCMainVideoViewControlsBar.h
=====================================
@@ -29,11 +29,13 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, strong) IBOutlet NSButton *bookmarksButton;
 @property (readwrite, strong) IBOutlet NSButton *subtitlesButton;
 @property (readwrite, strong) IBOutlet NSButton *audioButton;
+ at property (readwrite, strong) IBOutlet NSButton *videoButton;
 @property (readwrite, strong) IBOutlet NSButton *floatOnTopButton;
 
 - (IBAction)openBookmarks:(id)sender;
 - (IBAction)openSubtitlesMenu:(id)sender;
 - (IBAction)openAudioMenu:(id)sender;
+- (IBAction)openVideoMenu:(id)sender;
 - (IBAction)toggleFloatOnTop:(id)sender;
 
 @end


=====================================
modules/gui/macosx/windows/controlsbar/VLCMainVideoViewControlsBar.m
=====================================
@@ -63,6 +63,9 @@
     _audioButton.toolTip = _NS("Audio settings");
     _audioButton.accessibilityLabel = _audioButton.toolTip;
 
+    self.videoButton.toolTip = _NS("Video settings");
+    self.videoButton.accessibilityLabel = self.videoButton.toolTip;
+
     _playlistController = VLCMain.sharedInstance.playlistController;
     _playerController = _playlistController.playerController;
 
@@ -139,6 +142,14 @@
                             inView:((NSView *)sender).superview];
 }
 
+- (IBAction)openVideoMenu:(id)sender
+{
+    NSMenu * const menu = VLCMain.sharedInstance.mainMenu.videoMenu;
+    [menu popUpMenuPositioningItem:nil
+                        atLocation:self.videoButton.frame.origin
+                            inView:((NSView *)sender).superview];
+}
+
 - (IBAction)toggleFloatOnTop:(id)sender
 {
     VLCVideoWindowCommon * const window = (VLCVideoWindowCommon *)self.floatOnTopButton.window;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8e50335ec7b675ef50d507639ed1fa3959ebe4fd...b4c0be7d713db2f5eda2c2234ad1602cc63c0d93

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8e50335ec7b675ef50d507639ed1fa3959ebe4fd...b4c0be7d713db2f5eda2c2234ad1602cc63c0d93
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list