[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Change the size of the UI frame and components to fit in the widget panel
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Aug 23 05:08:57 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
e3d0e183 by joseanemsilva at 2026-08-23T04:39:51+00:00
macosx: Change the size of the UI frame and components to fit in the widget panel
- - - - -
cc68be53 by joseanemsilva at 2026-08-23T04:39:51+00:00
macosx: Add support to up and down arrow key event
- - - - -
69d81dbf by joseanemsilva at 2026-08-23T04:39:51+00:00
macosx: Add support for colon control
- - - - -
1187c714 by joseanemsilva at 2026-08-23T04:39:51+00:00
macosx: Implement pasting timestamps
Adds the possibility of users to paste a string
value, parsing it to a time value.
For example: "2:30" would update minutes to 2 and
seconds to 30.
- - - - -
7e36acb2 by joseanemsilva at 2026-08-23T04:39:51+00:00
macosx: Change jump to time feature design
Create a new design for the jump to time feature,
removing steppers and adding a slider to allow users
to change the time by typing or using a slider.
- - - - -
4 changed files:
- modules/gui/macosx/UI/TimeSelectionPanel.xib
- modules/gui/macosx/menus/VLCMainMenu.m
- modules/gui/macosx/panels/VLCTimeSelectionPanelController.h
- modules/gui/macosx/panels/VLCTimeSelectionPanelController.m
Changes:
=====================================
modules/gui/macosx/UI/TimeSelectionPanel.xib
=====================================
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24765" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24765"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -10,10 +10,14 @@
<connections>
<outlet property="cancelButton" destination="C7h-06-Udn" id="vms-H9-Fs6"/>
<outlet property="goToLabel" destination="bB6-Le-Ilg" id="Psy-fF-eTf"/>
- <outlet property="hoursLabel" destination="nrO-yt-AnE" id="twB-pr-AtL"/>
+ <outlet property="hoursLabel" destination="hoj-E1-zWh" id="NZs-Ub-M2t"/>
+ <outlet property="hoursValueField" destination="KFt-K5-ogc" id="0sD-O9-3lm"/>
<outlet property="minsLabel" destination="jTf-bH-u7w" id="e6b-gc-MHz"/>
+ <outlet property="minsValueField" destination="Smg-Kh-Pjv" id="SzV-8C-Zwx"/>
<outlet property="okButton" destination="zrN-B3-Ede" id="TzS-HN-YE3"/>
<outlet property="secsLabel" destination="oMI-0n-rej" id="Heh-nH-7Dv"/>
+ <outlet property="secsValueField" destination="ovY-qj-fWV" id="nRq-T4-9hF"/>
+ <outlet property="slider" destination="RNE-aM-lcf" id="qDJ-Ku-Pl4"/>
<outlet property="window" destination="Fqe-af-Tt9" id="u4H-rX-p0W"/>
</connections>
</customObject>
@@ -22,28 +26,38 @@
<window title="GoTo Specific Time" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="Fqe-af-Tt9" userLabel="GoToTime">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
- <rect key="contentRect" x="429" y="553" width="265" height="110"/>
- <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
+ <rect key="contentRect" x="429" y="553" width="265" height="165"/>
+ <rect key="screenRect" x="0.0" y="0.0" width="3008" height="1662"/>
+ <value key="minSize" type="size" width="280" height="165"/>
+ <value key="minFullScreenContentSize" type="size" width="280" height="110"/>
<view key="contentView" id="NrR-3A-NOR">
- <rect key="frame" x="0.0" y="0.0" width="265" height="110"/>
+ <rect key="frame" x="0.0" y="0.0" width="221" height="165"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="bB6-Le-Ilg" userLabel="Testlabel">
- <rect key="frame" x="56" y="87" width="153" height="17"/>
+ <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="bB6-Le-Ilg" userLabel="Testlabel">
+ <rect key="frame" x="34" y="141" width="153" height="16"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Go to specific position" id="vXn-nw-Nrc">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ovY-qj-fWV" userLabel="Secs Text Field">
- <rect key="frame" x="176" y="50" width="33" height="19"/>
+ <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ovY-qj-fWV" userLabel="Secs Text Field">
+ <rect key="frame" x="153" y="81" width="33" height="22"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="0" drawsBackground="YES" id="qZx-Li-5O2">
+ <numberFormatter key="formatter" formatterBehavior="default10_4" numberStyle="decimal" formatWidth="-1" minimumIntegerDigits="1" maximumIntegerDigits="2000000000" maximumFractionDigits="3" id="RGX-Wz-N76">
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="number" keyPath="minimumIntegerDigits">
+ <integer key="value" value="2"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </numberFormatter>
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
+ <action selector="textFieldChanged:" target="-2" id="cY1-BD-0t2"/>
<binding destination="-2" name="value" keyPath="self.jumpSecsValue" id="Vrp-5K-RQW">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
@@ -53,9 +67,16 @@
<outlet property="nextKeyView" destination="KFt-K5-ogc" id="Wnf-MK-lCP"/>
</connections>
</textField>
- <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Smg-Kh-Pjv" userLabel="Mins Text Field">
- <rect key="frame" x="94" y="50" width="33" height="19"/>
+ <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Smg-Kh-Pjv" userLabel="Mins Text Field">
+ <rect key="frame" x="94" y="81" width="33" height="22"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="0" drawsBackground="YES" id="2wj-p0-8uH">
+ <numberFormatter key="formatter" formatterBehavior="default10_4" numberStyle="decimal" formatWidth="-1" minimumIntegerDigits="1" maximumIntegerDigits="2000000000" maximumFractionDigits="3" id="zMe-2c-Xjf">
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="number" keyPath="minimumIntegerDigits">
+ <integer key="value" value="2"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </numberFormatter>
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -70,12 +91,19 @@
<outlet property="nextKeyView" destination="ovY-qj-fWV" id="CkK-ug-uuR"/>
</connections>
</textField>
- <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KFt-K5-ogc" userLabel="Hours Text Field">
- <rect key="frame" x="20" y="50" width="33" height="19"/>
+ <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KFt-K5-ogc" userLabel="Hours Text Field">
+ <rect key="frame" x="35" y="81" width="33" height="22"/>
<constraints>
<constraint firstAttribute="width" constant="33" id="xwZ-sK-Qq8"/>
</constraints>
- <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="0" drawsBackground="YES" id="UWz-WZ-unY">
+ <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" drawsBackground="YES" id="UWz-WZ-unY">
+ <numberFormatter key="formatter" formatterBehavior="default10_4" numberStyle="decimal" formatWidth="-1" minimumIntegerDigits="1" maximumIntegerDigits="2000000000" maximumFractionDigits="3" id="Eyv-5c-GVV">
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="number" keyPath="minimumIntegerDigits">
+ <integer key="value" value="2"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </numberFormatter>
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -90,56 +118,57 @@
<outlet property="nextKeyView" destination="Smg-Kh-Pjv" id="aPL-uL-qxZ"/>
</connections>
</textField>
- <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsp-zD-QHr" userLabel="Secs Stepper">
- <rect key="frame" x="209" y="48" width="15" height="22"/>
- <stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" maxValue="30000" id="8Ok-J5-Vfx"/>
- <connections>
- <binding destination="-2" name="value" keyPath="self.jumpSecsValue" previousBinding="G0w-1a-j9i" id="Dbd-qx-86s"/>
- <binding destination="-2" name="maxValue" keyPath="self.secsMax" id="G0w-1a-j9i"/>
- </connections>
- </stepper>
- <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xMh-Kx-bRX">
- <rect key="frame" x="127" y="48" width="15" height="22"/>
- <stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" maxValue="30000" id="WNB-18-kN2"/>
- <connections>
- <binding destination="-2" name="value" keyPath="self.jumpMinsValue" previousBinding="s1m-Vn-LGE" id="S3p-kD-BS5"/>
- <binding destination="-2" name="maxValue" keyPath="self.minsMax" id="s1m-Vn-LGE"/>
- </connections>
- </stepper>
- <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Un1-2R-ijf">
- <rect key="frame" x="53" y="48" width="15" height="22"/>
- <stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" maxValue="30000" id="c5h-G9-LlU"/>
- <connections>
- <binding destination="-2" name="maxValue" keyPath="self.hoursMax" id="ubF-Xt-qiY"/>
- <binding destination="-2" name="value" keyPath="self.jumpHoursValue" previousBinding="ubF-Xt-qiY" id="fTw-EH-qRY"/>
- </connections>
- </stepper>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="oMI-0n-rej">
- <rect key="frame" x="222" y="53" width="25" height="16"/>
- <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="ss" id="74c-xI-3AS">
+ <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="oMI-0n-rej">
+ <rect key="frame" x="156" y="111" width="28" height="15"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="24" id="uRC-ZJ-3jK"/>
+ </constraints>
+ <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="sec" id="74c-xI-3AS">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jTf-bH-u7w">
- <rect key="frame" x="141" y="53" width="25" height="16"/>
- <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="mm" id="8HU-gm-EEa">
+ <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jTf-bH-u7w">
+ <rect key="frame" x="97" y="111" width="28" height="15"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="24" id="tTC-3x-Mv4"/>
+ </constraints>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="min" id="8HU-gm-EEa">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nrO-yt-AnE">
- <rect key="frame" x="66" y="53" width="19" height="16"/>
- <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="hh" id="24d-8K-jxZ">
+ <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nrO-yt-AnE">
+ <rect key="frame" x="77" y="85" width="8" height="15"/>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title=":" id="24d-8K-jxZ">
+ <font key="font" metaFont="cellTitle"/>
+ <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FW5-ak-aXx">
+ <rect key="frame" x="136" y="85" width="8" height="15"/>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title=":" id="vDA-II-xKN">
+ <font key="font" metaFont="cellTitle"/>
+ <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hoj-E1-zWh">
+ <rect key="frame" x="38" y="111" width="28" height="15"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="24" id="nXi-AL-LAz"/>
+ </constraints>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="hr" id="PS9-yO-b2B">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zrN-B3-Ede">
- <rect key="frame" x="208" y="15" width="42" height="27"/>
+ <rect key="frame" x="150" y="21" width="36" height="20"/>
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" inset="2" id="icy-jS-WFH">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -151,8 +180,21 @@ DQ
<action selector="buttonPressed:" target="-2" id="0qF-5H-5Fz"/>
</connections>
</button>
+ <slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RNE-aM-lcf">
+ <rect key="frame" x="36" y="53" width="147" height="16"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="147" id="B9t-2o-3oh"/>
+ </constraints>
+ <sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="Mp3-h7-xpy">
+ <font key="font" size="12" name="Helvetica"/>
+ </sliderCell>
+ <connections>
+ <binding destination="-2" name="maxValue" keyPath="self.maxTime" id="ele-YJ-xSk"/>
+ <binding destination="-2" name="value" keyPath="self.jumpTotalSecs" previousBinding="ele-YJ-xSk" id="mmy-a5-0Y9"/>
+ </connections>
+ </slider>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="C7h-06-Udn">
- <rect key="frame" x="148" y="15" width="62" height="27"/>
+ <rect key="frame" x="82" y="21" width="56" height="20"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" inset="2" id="fXt-nh-exA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -166,85 +208,70 @@ Gw
</button>
</subviews>
<constraints>
- <constraint firstItem="nrO-yt-AnE" firstAttribute="baseline" secondItem="KFt-K5-ogc" secondAttribute="baseline" id="08O-Hq-yaf"/>
- <constraint firstItem="ovY-qj-fWV" firstAttribute="leading" secondItem="jTf-bH-u7w" secondAttribute="trailing" constant="12" id="0WE-Bg-ZGS"/>
+ <constraint firstItem="bB6-Le-Ilg" firstAttribute="top" secondItem="NrR-3A-NOR" secondAttribute="top" constant="8" id="0VG-Bm-H6f"/>
<constraint firstItem="KFt-K5-ogc" firstAttribute="width" secondItem="Smg-Kh-Pjv" secondAttribute="width" id="24N-1L-5Qx"/>
- <constraint firstItem="C7h-06-Udn" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="NrR-3A-NOR" secondAttribute="leading" constant="16" symbolic="YES" id="8C2-n0-ddd" customClass="VLCSpacingConstraint">
+ <constraint firstItem="C7h-06-Udn" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="NrR-3A-NOR" secondAttribute="leading" constant="20" symbolic="YES" id="8C2-n0-ddd" customClass="VLCSpacingConstraint">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="spacingToken">
- <integer value="3"/>
+ <integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</constraint>
- <constraint firstItem="bB6-Le-Ilg" firstAttribute="top" secondItem="NrR-3A-NOR" secondAttribute="top" constant="6" id="AmG-Sh-CJP"/>
- <constraint firstItem="xMh-Kx-bRX" firstAttribute="leading" secondItem="Smg-Kh-Pjv" secondAttribute="trailing" constant="2" id="CyX-lL-1I2"/>
+ <constraint firstItem="ovY-qj-fWV" firstAttribute="leading" secondItem="FW5-ak-aXx" secondAttribute="trailing" constant="11" id="8Rz-EK-CzS"/>
+ <constraint firstItem="hoj-E1-zWh" firstAttribute="top" secondItem="bB6-Le-Ilg" secondAttribute="bottom" constant="15" id="An4-L4-3Qd"/>
+ <constraint firstItem="hoj-E1-zWh" firstAttribute="centerX" secondItem="KFt-K5-ogc" secondAttribute="centerX" id="CQn-31-E6x"/>
+ <constraint firstItem="oMI-0n-rej" firstAttribute="leading" secondItem="jTf-bH-u7w" secondAttribute="trailing" constant="35" id="GCa-N0-IKB"/>
<constraint firstItem="ovY-qj-fWV" firstAttribute="baseline" secondItem="KFt-K5-ogc" secondAttribute="baseline" id="Hee-6R-Kdn"/>
- <constraint firstItem="jTf-bH-u7w" firstAttribute="leading" secondItem="xMh-Kx-bRX" secondAttribute="trailing" constant="3" id="Hm4-N4-hNM" userLabel="Mins Label.leading = Mins Stepper.trailing + 2"/>
- <constraint firstAttribute="trailing" secondItem="oMI-0n-rej" secondAttribute="trailing" constant="16" symbolic="YES" id="JlG-tA-T1w" customClass="VLCSpacingConstraint">
- <userDefinedRuntimeAttributes>
- <userDefinedRuntimeAttribute type="number" keyPath="spacingToken">
- <integer value="3"/>
- </userDefinedRuntimeAttribute>
- </userDefinedRuntimeAttributes>
- </constraint>
- <constraint firstItem="jTf-bH-u7w" firstAttribute="baseline" secondItem="KFt-K5-ogc" secondAttribute="baseline" id="JxE-ZG-eSY"/>
+ <constraint firstItem="FW5-ak-aXx" firstAttribute="leading" secondItem="Smg-Kh-Pjv" secondAttribute="trailing" constant="11" id="Hfl-vg-I8F"/>
+ <constraint firstItem="KFt-K5-ogc" firstAttribute="leading" relation="lessThanOrEqual" secondItem="NrR-3A-NOR" secondAttribute="leading" constant="35" id="Kxf-pd-936"/>
<constraint firstItem="C7h-06-Udn" firstAttribute="baseline" secondItem="zrN-B3-Ede" secondAttribute="baseline" id="PVu-B9-CmM"/>
- <constraint firstItem="KFt-K5-ogc" firstAttribute="leading" secondItem="NrR-3A-NOR" secondAttribute="leading" constant="16" symbolic="YES" id="PfD-38-yip" customClass="VLCSpacingConstraint">
- <userDefinedRuntimeAttributes>
- <userDefinedRuntimeAttribute type="number" keyPath="spacingToken">
- <integer value="3"/>
- </userDefinedRuntimeAttribute>
- </userDefinedRuntimeAttributes>
- </constraint>
- <constraint firstItem="Un1-2R-ijf" firstAttribute="leading" secondItem="KFt-K5-ogc" secondAttribute="trailing" constant="2" id="Rhe-9Q-woZ"/>
- <constraint firstItem="zsp-zD-QHr" firstAttribute="leading" secondItem="ovY-qj-fWV" secondAttribute="trailing" constant="2" id="SZW-yH-BM4"/>
- <constraint firstItem="zrN-B3-Ede" firstAttribute="top" secondItem="oMI-0n-rej" secondAttribute="bottom" constant="14" id="SiP-hv-2S0"/>
- <constraint firstItem="KFt-K5-ogc" firstAttribute="centerY" secondItem="Un1-2R-ijf" secondAttribute="centerY" id="WUd-ZI-Bol"/>
- <constraint firstItem="Smg-Kh-Pjv" firstAttribute="centerY" secondItem="xMh-Kx-bRX" secondAttribute="centerY" id="X15-o0-6ZP"/>
- <constraint firstItem="zrN-B3-Ede" firstAttribute="leading" secondItem="C7h-06-Udn" secondAttribute="trailing" constant="8" id="XLd-j6-TX5" customClass="VLCSpacingConstraint">
- <userDefinedRuntimeAttributes>
- <userDefinedRuntimeAttribute type="number" keyPath="spacingToken">
- <integer value="2"/>
- </userDefinedRuntimeAttribute>
- </userDefinedRuntimeAttributes>
- </constraint>
- <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="bB6-Le-Ilg" secondAttribute="trailing" constant="16" symbolic="YES" id="epj-mp-Lnm" customClass="VLCSpacingConstraint">
+ <constraint firstItem="jTf-bH-u7w" firstAttribute="centerX" secondItem="Smg-Kh-Pjv" secondAttribute="centerX" id="RYV-JZ-UBS"/>
+ <constraint firstItem="zrN-B3-Ede" firstAttribute="top" secondItem="RNE-aM-lcf" secondAttribute="bottom" constant="12" id="SiP-hv-2S0"/>
+ <constraint firstItem="nrO-yt-AnE" firstAttribute="centerY" secondItem="KFt-K5-ogc" secondAttribute="centerY" constant="-0.5" id="T2g-U9-OAh"/>
+ <constraint firstItem="zrN-B3-Ede" firstAttribute="leading" secondItem="C7h-06-Udn" secondAttribute="trailing" constant="12" id="XLd-j6-TX5" customClass="VLCSpacingConstraint">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="spacingToken">
- <integer value="3"/>
+ <integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</constraint>
- <constraint firstItem="oMI-0n-rej" firstAttribute="leading" secondItem="zsp-zD-QHr" secondAttribute="trailing" constant="2" id="g1Z-YD-UJw"/>
- <constraint firstAttribute="trailing" secondItem="zrN-B3-Ede" secondAttribute="trailing" constant="16" id="gCl-V6-Bjt" customClass="VLCSpacingConstraint">
+ <constraint firstItem="nrO-yt-AnE" firstAttribute="leading" secondItem="KFt-K5-ogc" secondAttribute="trailing" constant="11" id="Xny-Za-GWV"/>
+ <constraint firstAttribute="trailing" relation="lessThanOrEqual" secondItem="ovY-qj-fWV" secondAttribute="trailing" constant="35" id="agW-tb-8WG"/>
+ <constraint firstItem="jTf-bH-u7w" firstAttribute="leading" secondItem="hoj-E1-zWh" secondAttribute="trailing" constant="35" id="dxq-Lf-enG"/>
+ <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="bB6-Le-Ilg" secondAttribute="trailing" constant="20" symbolic="YES" id="epj-mp-Lnm" customClass="VLCSpacingConstraint">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="spacingToken">
- <integer value="3"/>
+ <integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</constraint>
- <constraint firstItem="ovY-qj-fWV" firstAttribute="centerY" secondItem="zsp-zD-QHr" secondAttribute="centerY" id="iXo-b7-Mh2"/>
- <constraint firstItem="bB6-Le-Ilg" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="NrR-3A-NOR" secondAttribute="leading" constant="16" symbolic="YES" id="j6a-V4-oje" customClass="VLCSpacingConstraint">
+ <constraint firstItem="FW5-ak-aXx" firstAttribute="centerY" secondItem="KFt-K5-ogc" secondAttribute="centerY" constant="-0.5" id="hqm-TU-kPZ"/>
+ <constraint firstItem="RNE-aM-lcf" firstAttribute="centerX" secondItem="NrR-3A-NOR" secondAttribute="centerX" constant="-1" id="ipf-3f-Ndw"/>
+ <constraint firstItem="bB6-Le-Ilg" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="NrR-3A-NOR" secondAttribute="leading" constant="20" symbolic="YES" id="j6a-V4-oje" customClass="VLCSpacingConstraint">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="spacingToken">
- <integer value="3"/>
+ <integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</constraint>
+ <constraint firstItem="ovY-qj-fWV" firstAttribute="top" secondItem="oMI-0n-rej" secondAttribute="bottom" constant="8" id="jEX-dY-A5l"/>
<constraint firstItem="Smg-Kh-Pjv" firstAttribute="width" secondItem="ovY-qj-fWV" secondAttribute="width" id="jHZ-4g-K0X"/>
- <constraint firstItem="nrO-yt-AnE" firstAttribute="leading" secondItem="Un1-2R-ijf" secondAttribute="trailing" constant="2" id="kjd-h3-aEZ"/>
- <constraint firstItem="oMI-0n-rej" firstAttribute="baseline" secondItem="KFt-K5-ogc" secondAttribute="baseline" id="lyY-Ad-caz"/>
+ <constraint firstAttribute="trailing" secondItem="zrN-B3-Ede" secondAttribute="trailing" constant="35" id="kTd-zX-Fbp"/>
+ <constraint firstItem="oMI-0n-rej" firstAttribute="centerX" secondItem="ovY-qj-fWV" secondAttribute="centerX" id="kjp-dh-svN"/>
<constraint firstItem="Smg-Kh-Pjv" firstAttribute="baseline" secondItem="KFt-K5-ogc" secondAttribute="baseline" id="mOE-Qf-1wF"/>
<constraint firstAttribute="bottom" secondItem="zrN-B3-Ede" secondAttribute="bottom" constant="21" id="nIx-yc-atT"/>
- <constraint firstItem="KFt-K5-ogc" firstAttribute="top" secondItem="bB6-Le-Ilg" secondAttribute="bottom" constant="18" id="oqx-8I-mgW"/>
+ <constraint firstItem="KFt-K5-ogc" firstAttribute="top" secondItem="hoj-E1-zWh" secondAttribute="bottom" constant="8" id="oqx-8I-mgW"/>
<constraint firstItem="Smg-Kh-Pjv" firstAttribute="leading" secondItem="nrO-yt-AnE" secondAttribute="trailing" constant="11" id="rnE-ZZ-e08"/>
+ <constraint firstItem="Smg-Kh-Pjv" firstAttribute="top" secondItem="jTf-bH-u7w" secondAttribute="bottom" constant="8" id="sWo-wx-seG"/>
<constraint firstItem="bB6-Le-Ilg" firstAttribute="centerX" secondItem="NrR-3A-NOR" secondAttribute="centerX" id="uga-pS-4jS"/>
+ <constraint firstItem="RNE-aM-lcf" firstAttribute="top" secondItem="KFt-K5-ogc" secondAttribute="bottom" constant="12" id="yQf-S8-ASR"/>
</constraints>
</view>
<connections>
<outlet property="initialFirstResponder" destination="KFt-K5-ogc" id="RUn-tc-Qvg"/>
</connections>
- <point key="canvasLocation" x="146.5" y="157"/>
+ <point key="canvasLocation" x="145.5" y="156.5"/>
</window>
+ <userDefaultsController representsSharedInstance="YES" id="0Fs-zF-K5X"/>
</objects>
</document>
=====================================
modules/gui/macosx/menus/VLCMainMenu.m
=====================================
@@ -1048,7 +1048,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
vlc_tick_t length = _playerController.length;
[_timeSelectionPanel setMaxTime:(int)SEC_FROM_VLC_TICK(length)];
vlc_tick_t time = _playerController.time;
- [_timeSelectionPanel setPosition:(int)SEC_FROM_VLC_TICK(time)];
+ [_timeSelectionPanel setJumpTotalSecs:(int)SEC_FROM_VLC_TICK(time)];
[_timeSelectionPanel runModalForWindow:[NSApp mainWindow]
completionHandler:^(NSInteger returnCode, int64_t returnTime) {
if (returnCode != NSModalResponseOK)
=====================================
modules/gui/macosx/panels/VLCTimeSelectionPanelController.h
=====================================
@@ -29,32 +29,34 @@
@property (readwrite, weak) IBOutlet NSTextField *secsLabel;
@property (readwrite, weak) IBOutlet NSTextField *minsLabel;
@property (readwrite, weak) IBOutlet NSTextField *hoursLabel;
+ at property (readwrite, weak) IBOutlet NSTextField *secsValueField;
+ at property (readwrite, weak) IBOutlet NSTextField *minsValueField;
+ at property (readwrite, weak) IBOutlet NSTextField *hoursValueField;
+ at property (readwrite, weak) IBOutlet NSSlider *slider;
- at property (nonatomic) int jumpSecsValue;
- at property (nonatomic) int jumpMinsValue;
- at property (nonatomic) int jumpHoursValue;
- at property (nonatomic) int secsMax;
- at property (nonatomic) int minsMax;
- at property (nonatomic) int hoursMax;
+ at property (nonatomic) NSInteger jumpSecsValue;
+ at property (nonatomic) NSInteger jumpMinsValue;
+ at property (nonatomic) NSInteger jumpHoursValue;
+ at property (nonatomic) NSInteger maxTime;
- (IBAction)buttonPressed:(id)sender;
-- (int)getTimeInSecs;
-- (void)setMaxTime:(int)secsMax;
-- (void)setPosition:(int)secsPos;
+- (NSInteger)jumpTotalSecs;
+- (void)setJumpTotalSecs:(NSInteger)secsPos;
/**
* Completion handler for textfield panel
* \param returnCode Result from panel. Can be NSModalResponseOK or NSModalResponseCancel.
* \param returnTime Resulting time in seconds entered in panel.
*/
-typedef void(^TimeSelectionCompletionHandler)(NSInteger returnCode, int64_t returnTime);
+typedef void (^TimeSelectionCompletionHandler)(NSInteger returnCode, int64_t returnTime);
/**
* Shows the panel as a modal dialog with window as its owner.
* \param window Parent window for the dialog.
* \param handler Completion block.
*/
-- (void)runModalForWindow:(NSWindow *)window completionHandler:(TimeSelectionCompletionHandler)handler;
+- (void)runModalForWindow:(NSWindow *)window
+ completionHandler:(TimeSelectionCompletionHandler)handler;
@end
=====================================
modules/gui/macosx/panels/VLCTimeSelectionPanelController.m
=====================================
@@ -23,9 +23,10 @@
#import "extensions/NSString+Helpers.h"
- at interface VLCTimeSelectionPanelController()
+ at interface VLCTimeSelectionPanelController ()
{
TimeSelectionCompletionHandler _completionHandler;
+ id _keyMonitor;
}
@end
@@ -43,53 +44,47 @@
- (void)windowDidLoad
{
- [_cancelButton setTitle: _NS("Cancel")];
- [_okButton setTitle: _NS("OK")];
- [_secsLabel setStringValue: _NS("ss")];
- [_minsLabel setStringValue: _NS("mm")];
- [_hoursLabel setStringValue: _NS("hh")];
- [_goToLabel setStringValue: _NS("Jump to Time")];
+ [_cancelButton setTitle:_NS("Cancel")];
+ [_okButton setTitle:_NS("OK")];
+ [_secsLabel setStringValue:_NS("sec")];
+ [_minsLabel setStringValue:_NS("min")];
+ [_hoursLabel setStringValue:_NS("hr")];
+ [_goToLabel setStringValue:_NS("Jump to Time")];
}
- (void)controlTextDidChange:(NSNotification *)notification
{
- [self setPosition:[self getTimeInSecs]];
-}
-
-- (void)setMaxTime:(int)secsMax
-{
- [self setHoursMax:(int)secsMax / 3600];
+ NSTextField *sender = notification.object;
+ NSString *stringValue = sender.stringValue;
- if (secsMax >= 3600) {
- [self setMinsMax:59];
- [self setSecsMax:59];
- }
- else if (secsMax >= 60) {
- [self setMinsMax:(int)secsMax / 60];
- [self setSecsMax:59];
- }
- else {
- [self setSecsMax:secsMax];
- [self setMinsMax:0];
+ if ([stringValue containsString:@":"]) {
+ [self applyColonSeparatedDimensions:stringValue startingAtField:sender];
+ [self setJumpTotalSecs:[self jumpTotalSecs]];
+ return;
}
+
+ [self setJumpTotalSecs:[self jumpTotalSecs]];
}
-- (void)setPosition:(int)secsPos
+- (void)setJumpTotalSecs:(NSInteger)secsPos
{
- int minsPos = secsPos / 60;
+ if (self.maxTime != VLC_TICK_INVALID) {
+ secsPos = MAX(MIN(secsPos, self.maxTime), 0);
+ }
+
+ NSInteger minsPos = secsPos / 60;
secsPos = secsPos % 60;
- int hoursPos = minsPos / 60;
+ const NSInteger hoursPos = minsPos / 60;
minsPos = minsPos % 60;
- [self setJumpSecsValue: secsPos];
- [self setJumpMinsValue: minsPos];
- [self setJumpHoursValue: hoursPos];
+ [self setJumpSecsValue:secsPos];
+ [self setJumpMinsValue:minsPos];
+ [self setJumpHoursValue:hoursPos];
}
-- (int)getTimeInSecs
+- (NSInteger)jumpTotalSecs
{
- // calculate resulting time in secs:
- int timeInSec = self.jumpSecsValue;
+ NSInteger timeInSec = self.jumpSecsValue;
timeInSec += self.jumpMinsValue * 60;
timeInSec += self.jumpHoursValue * 3600;
return timeInSec;
@@ -98,17 +93,141 @@
- (IBAction)buttonPressed:(id)sender
{
[self.window orderOut:sender];
- [NSApp endSheet: self.window];
- int64_t timeInSec = [self getTimeInSecs];
+ [NSApp endSheet:self.window];
+ int64_t timeInSec = [self jumpTotalSecs];
if (_completionHandler)
- _completionHandler(sender == _okButton ? NSModalResponseOK : NSModalResponseCancel, timeInSec);
+ _completionHandler(sender == _okButton ? NSModalResponseOK : NSModalResponseCancel,
+ timeInSec);
}
-- (void)runModalForWindow:(NSWindow *)window completionHandler:(TimeSelectionCompletionHandler)handler
+- (void)runModalForWindow:(NSWindow *)window
+ completionHandler:(TimeSelectionCompletionHandler)handler
{
+ __weak typeof(self) weakSelf = self;
+
+ _keyMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyDown
+ handler:^NSEvent *(NSEvent *event) {
+ return [weakSelf handleKeyEvent:event];
+ }];
+
_completionHandler = handler;
- [window beginSheet:self.window completionHandler:nil];
+
+ [window beginSheet:self.window
+ completionHandler:^(NSModalResponse returnCode) {
+ if (self->_keyMonitor) {
+ [NSEvent removeMonitor:self->_keyMonitor];
+ }
+ }];
+}
+
+- (NSEvent *)handleKeyEvent:(NSEvent *)event
+{
+ NSString *const chars = event.characters;
+ if (chars.length == 0) {
+ return event;
+ }
+
+ if ([chars isEqualToString:@":"]) {
+ if ([self moveToNextField]) {
+ return nil;
+ }
+ return event;
+ }
+
+ unichar key = [chars characterAtIndex:0];
+
+ if (key != NSUpArrowFunctionKey && key != NSDownArrowFunctionKey) {
+ return event;
+ }
+
+ id responder = self.window.firstResponder;
+
+ if (![responder isKindOfClass:[NSTextView class]]) {
+ return event;
+ }
+
+ const NSInteger timeDifference = [self getTimeDifference:[responder delegate]];
+
+ if (!timeDifference) {
+ return event;
+ }
+
+ if (key == NSUpArrowFunctionKey) {
+ [self setJumpTotalSecs:[self jumpTotalSecs] + timeDifference];
+ } else if (key == NSDownArrowFunctionKey) {
+ [self setJumpTotalSecs:[self jumpTotalSecs] - timeDifference];
+ }
+ return nil;
+}
+
+- (NSInteger)getTimeDifference:(NSTextField *)textField
+{
+ if (textField == self.hoursValueField) {
+ return 3600;
+ } else if (textField == self.minsValueField) {
+ return 60;
+ } else if (textField == self.secsValueField) {
+ return 1;
+ }
+ return 0;
+}
+
+- (BOOL)moveToNextField
+{
+ NSWindow *window = self.window;
+ id responder = window.firstResponder;
+
+ if (![responder isKindOfClass:[NSTextView class]]) {
+ return NO;
+ }
+
+ NSTextView *textView = responder;
+ id delegate = textView.delegate;
+
+ if (delegate == self.hoursValueField) {
+ [window makeFirstResponder:self.minsValueField];
+ return YES;
+ } else if (delegate == self.minsValueField) {
+ [window makeFirstResponder:self.secsValueField];
+ return YES;
+ } else if (delegate == self.secsValueField) {
+ return YES;
+ }
+ return NO;
+}
+
+- (void)applyColonSeparatedDimensions:(NSString *)text startingAtField:(NSTextField *)field
+{
+ NSArray<NSString *> *parts = [text componentsSeparatedByString:@":"];
+
+ NSInteger startingField = 0;
+ NSInteger currentFieldSecs = [self getTimeDifference:field];
+
+ if (currentFieldSecs == 3600) {
+ startingField = 0;
+ } else if (currentFieldSecs == 60) {
+ startingField = 1;
+ } else if (currentFieldSecs == 1) {
+ startingField = 2;
+ } else {
+ return;
+ }
+
+ NSInteger count = MIN(parts.count, 3 - startingField);
+
+ NSInteger newPosition = 0;
+ NSInteger timeDifference = currentFieldSecs;
+ for (NSInteger i = 0; i < count; i++) {
+ NSString *part = [parts[i]
+ stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
+ newPosition += timeDifference * part.integerValue;
+ timeDifference /= 60;
+ }
+
+ [self setJumpTotalSecs:newPosition];
+ NSInteger currentFieldValue = (self.jumpTotalSecs / currentFieldSecs);
+ [field setStringValue:@(currentFieldValue).stringValue];
}
@end
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/28781c4bf3a2557dd83cd33636e4784852e5b776...7e36acb27fa6fa253677799c606f04c28b27645c
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/28781c4bf3a2557dd83cd33636e4784852e5b776...7e36acb27fa6fa253677799c606f04c28b27645c
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list