diff options
author | ritsuka <[email protected]> | 2014-08-22 17:59:21 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-08-22 17:59:21 +0000 |
commit | ad7edc8fb58a256881fd470801e80dbb425cc79f (patch) | |
tree | 5552786381f3866295c90ae782afbc7935e584c2 | |
parent | 7e22c9f782914792c38323081844f972fcdf63a7 (diff) |
MacGui: fixed the preview controller HUD style on the next OS X release.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6347 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/English.lproj/PicturePreview.xib | 402 | ||||
-rw-r--r-- | macosx/HBHUDView.h | 15 | ||||
-rw-r--r-- | macosx/HBHUDView.m | 95 | ||||
-rw-r--r-- | macosx/HBPreviewController.m | 92 | ||||
-rw-r--r-- | macosx/HandBrake.xcodeproj/project.pbxproj | 6 |
5 files changed, 381 insertions, 229 deletions
diff --git a/macosx/English.lproj/PicturePreview.xib b/macosx/English.lproj/PicturePreview.xib index ac699b0f8..53c5a1a27 100644 --- a/macosx/English.lproj/PicturePreview.xib +++ b/macosx/English.lproj/PicturePreview.xib @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13F7" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="14A329r" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <dependencies> - <deployment version="1060" defaultVersion="1090" identifier="macosx"/> + <deployment version="1060" defaultVersion="1060" identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/> <plugIn identifier="com.apple.QTKitIBPlugin" version="5056"/> </dependencies> @@ -10,17 +10,17 @@ <connections> <outlet property="fCancelPreviewMovieButton" destination="261" id="263"/> <outlet property="fCreatePreviewMovieButton" destination="215" id="217"/> - <outlet property="fEncodingControlBox" destination="252" id="253"/> + <outlet property="fEncodingControlBox" destination="F8A-dU-Y1l" id="s29-SQ-WXg"/> <outlet property="fGoToBeginningButton" destination="375" id="380"/> <outlet property="fGoToEndButton" destination="378" id="381"/> <outlet property="fGoToStillPreviewButton" destination="365" id="368"/> <outlet property="fInfoField" destination="38" id="73"/> <outlet property="fMovieCreationProgressIndicator" destination="213" id="214"/> <outlet property="fMovieInfoField" destination="372" id="374"/> - <outlet property="fMoviePlaybackControlBox" destination="335" id="363"/> + <outlet property="fMoviePlaybackControlBox" destination="COi-Ia-2yt" id="dcQ-Bp-1jG"/> <outlet property="fMovieScrubberSlider" destination="341" id="371"/> <outlet property="fMovieView" destination="207" id="208"/> - <outlet property="fPictureControlBox" destination="251" id="254"/> + <outlet property="fPictureControlBox" destination="2me-4k-EDi" id="ABj-KD-Z3U"/> <outlet property="fPictureSettingsToggleButton" destination="271" id="273"/> <outlet property="fPictureSlider" destination="209" id="211"/> <outlet property="fPlayPauseButton" destination="361" id="364"/> @@ -47,215 +47,197 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="fillColor" red="0.80000000999999998" green="0.80000000999999998" blue="0.80000000999999998" alpha="1" colorSpace="calibratedRGB"/> </qtMovieView> - <box hidden="YES" autoresizesSubviews="NO" borderWidth="2" cornerRadius="12" title="Picture Controls" boxType="custom" borderType="line" titlePosition="noTitle" id="251"> + <customView id="2me-4k-EDi" userLabel="Picture Controls" customClass="HBHUDView"> <rect key="frame" x="15" y="132" width="460" height="100"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> - <view key="contentView"> - <rect key="frame" x="2" y="2" width="456" height="96"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <button toolTip="Encode And Play Back A Live Preview At Your Current Settings" verticalHuggingPriority="750" id="215"> - <rect key="frame" x="17" y="11" width="77" height="16"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <buttonCell key="cell" type="push" title="Live Preview" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="216"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="miniSystem"/> - </buttonCell> - <connections> - <action selector="createMoviePreview:" target="-2" id="218"/> - </connections> - </button> - <button toolTip="Show Picture Settings Inspector" verticalHuggingPriority="750" id="271"> - <rect key="frame" x="380" y="11" width="59" height="16"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> - <buttonCell key="cell" type="push" title="Settings" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="272"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="miniSystem"/> - </buttonCell> - <connections> - <action selector="showPictureSettings:" target="-2" id="274"/> - </connections> - </button> - <button toolTip="Scale Preview To Screen" verticalHuggingPriority="750" id="275"> - <rect key="frame" x="282" y="11" width="92" height="16"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> - <buttonCell key="cell" type="push" title="Scale To Screen" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="276"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="miniSystem"/> - </buttonCell> - <connections> - <action selector="toggleScaleToScreen:" target="-2" id="279"/> - </connections> - </button> - <textField verticalHuggingPriority="750" id="234"> - <rect key="frame" x="118" y="14" width="75" height="11"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> - <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Duration (sec):" id="235"> - <font key="font" metaFont="miniSystemBold"/> - <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> - <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> - <popUpButton toolTip="Select The Length Of Live Preview to Encode" verticalHuggingPriority="750" id="226"> - <rect key="frame" x="197" y="12" width="58" height="15"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> - <popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" controlSize="mini" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="231" id="227"> - <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="miniSystem"/> - <menu key="menu" title="OtherViews" id="228"> - <items> - <menuItem title="Item 1" state="on" id="231"/> - <menuItem title="Item 2" id="230"/> - <menuItem title="Item 3" id="229"/> - </items> - </menu> - </popUpButtonCell> - <connections> - <action selector="previewDurationPopUpChanged:" target="-2" id="233"/> - </connections> - </popUpButton> - <slider verticalHuggingPriority="750" id="209"> - <rect key="frame" x="18" y="39" width="420" height="16"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> - <sliderCell key="cell" controlSize="mini" continuous="YES" alignment="left" maxValue="9" tickMarkPosition="above" numberOfTickMarks="10" allowsTickMarkValuesOnly="YES" sliderType="linear" id="210"> - <font key="font" metaFont="miniSystem"/> - </sliderCell> - <connections> - <action selector="pictureSliderChanged:" target="-2" id="212"/> - </connections> - </slider> - <textField verticalHuggingPriority="750" id="38"> - <rect key="frame" x="15" y="55" width="430" height="20"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> - <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="left" id="165"> - <font key="font" metaFont="smallSystemBold"/> - <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> - <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> - <textField verticalHuggingPriority="750" id="280"> - <rect key="frame" x="15" y="77" width="426" height="12"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> - <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="left" id="281"> - <font key="font" metaFont="miniSystemBold"/> - <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> - <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> - </subviews> - </view> - <color key="borderColor" red="1" green="1" blue="1" alpha="0.80000000000000004" colorSpace="calibratedRGB"/> - <color key="fillColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="calibratedRGB"/> - </box> - <box hidden="YES" autoresizesSubviews="NO" borderWidth="2" cornerRadius="12" title="Playback Controls" boxType="custom" borderType="line" titlePosition="noTitle" id="335"> - <rect key="frame" x="15" y="30" width="460" height="100"/> + <subviews> + <button toolTip="Encode And Play Back A Live Preview At Your Current Settings" verticalHuggingPriority="750" id="215"> + <rect key="frame" x="17" y="11" width="80" height="16"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <buttonCell key="cell" type="push" title="Live Preview" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="216"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="miniSystem"/> + </buttonCell> + <connections> + <action selector="createMoviePreview:" target="-2" id="218"/> + </connections> + </button> + <button toolTip="Show Picture Settings Inspector" verticalHuggingPriority="750" id="271"> + <rect key="frame" x="378" y="11" width="61" height="16"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> + <buttonCell key="cell" type="push" title="Settings" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="272"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="miniSystem"/> + </buttonCell> + <connections> + <action selector="showPictureSettings:" target="-2" id="274"/> + </connections> + </button> + <button toolTip="Scale Preview To Screen" verticalHuggingPriority="750" id="275"> + <rect key="frame" x="276" y="11" width="96" height="16"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> + <buttonCell key="cell" type="push" title="Scale To Screen" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="276"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="miniSystem"/> + </buttonCell> + <connections> + <action selector="toggleScaleToScreen:" target="-2" id="279"/> + </connections> + </button> + <textField verticalHuggingPriority="750" id="234"> + <rect key="frame" x="118" y="14" width="75" height="11"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> + <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Duration (sec):" id="235"> + <font key="font" metaFont="miniSystemBold"/> + <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + </textField> + <popUpButton toolTip="Select The Length Of Live Preview to Encode" verticalHuggingPriority="750" id="226"> + <rect key="frame" x="197" y="12" width="58" height="15"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> + <popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" controlSize="mini" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="231" id="227"> + <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="miniSystem"/> + <menu key="menu" title="OtherViews" id="228"> + <items> + <menuItem title="Item 1" state="on" id="231"/> + <menuItem title="Item 2" id="230"/> + <menuItem title="Item 3" id="229"/> + </items> + </menu> + </popUpButtonCell> + <connections> + <action selector="previewDurationPopUpChanged:" target="-2" id="233"/> + </connections> + </popUpButton> + <slider verticalHuggingPriority="750" id="209"> + <rect key="frame" x="18" y="39" width="420" height="16"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> + <sliderCell key="cell" controlSize="mini" continuous="YES" alignment="left" maxValue="9" tickMarkPosition="above" numberOfTickMarks="10" allowsTickMarkValuesOnly="YES" sliderType="linear" id="210"> + <font key="font" metaFont="miniSystem"/> + </sliderCell> + <connections> + <action selector="pictureSliderChanged:" target="-2" id="212"/> + </connections> + </slider> + <textField verticalHuggingPriority="750" id="38"> + <rect key="frame" x="15" y="55" width="430" height="20"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> + <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="left" id="165"> + <font key="font" metaFont="smallSystemBold"/> + <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + </textField> + <textField verticalHuggingPriority="750" id="280"> + <rect key="frame" x="15" y="77" width="426" height="12"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> + <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="left" id="281"> + <font key="font" metaFont="miniSystemBold"/> + <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + </textField> + </subviews> + </customView> + <customView hidden="YES" id="COi-Ia-2yt" userLabel="Playback Controls" customClass="HBHUDView"> + <rect key="frame" x="15" y="24" width="460" height="100"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> - <view key="contentView"> - <rect key="frame" x="2" y="2" width="456" height="96"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <slider verticalHuggingPriority="750" id="341"> - <rect key="frame" x="16" y="16" width="337" height="21"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> - <sliderCell key="cell" continuous="YES" alignment="left" maxValue="100" tickMarkPosition="above" sliderType="linear" id="346"/> - <connections> - <action selector="previewScrubberChanged:" target="-2" id="384"/> - </connections> - </slider> - <button toolTip="Toggle Play/Pause" id="361"> - <rect key="frame" x="205" y="43" width="36" height="36"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="play-p" imagePosition="only" alignment="center" alternateImage="pause-p" imageScaling="proportionallyDown" id="362"> - <behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/> - <font key="font" metaFont="system"/> - </buttonCell> - <connections> - <action selector="toggleMoviePreviewPlayPause:" target="-2" id="370"/> - </connections> - </button> - <button toolTip="Go To Beginning" id="375"> - <rect key="frame" x="163" y="48" width="32" height="26"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="prev-p" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" id="376"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="system"/> - </buttonCell> - <connections> - <action selector="moviePlaybackGoToBeginning:" target="-2" id="382"/> - </connections> - </button> - <button toolTip="Go To End" id="378"> - <rect key="frame" x="251" y="48" width="32" height="26"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="next-p" imagePosition="only" alignment="center" controlSize="mini" imageScaling="proportionallyDown" id="379"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="miniSystem"/> - </buttonCell> - <connections> - <action selector="moviePlaybackGoToEnd:" target="-2" id="383"/> - </connections> - </button> - <button toolTip="Show Still Previews" verticalHuggingPriority="750" id="365"> - <rect key="frame" x="348" y="53" width="81" height="16"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <buttonCell key="cell" type="push" title="Still Previews" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="366"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="miniSystem"/> - </buttonCell> - <connections> - <action selector="showPicturesPreview:" target="-2" id="396"/> - </connections> - </button> - <textField verticalHuggingPriority="750" id="372"> - <rect key="frame" x="347" y="19" width="94" height="14"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> - <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="right" title="00:00:00" id="373"> - <font key="font" metaFont="smallSystemBold"/> - <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> - <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> - </subviews> - </view> - <color key="borderColor" red="1" green="1" blue="1" alpha="0.80000000000000004" colorSpace="calibratedRGB"/> - <color key="fillColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="calibratedRGB"/> - </box> - <box hidden="YES" autoresizesSubviews="NO" borderWidth="2" cornerRadius="12" title="Encoding Controls" boxType="custom" borderType="line" titlePosition="noTitle" id="252"> - <rect key="frame" x="15" y="235" width="460" height="100"/> + <subviews> + <slider verticalHuggingPriority="750" id="341"> + <rect key="frame" x="18" y="17" width="337" height="21"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> + <sliderCell key="cell" continuous="YES" alignment="left" maxValue="100" tickMarkPosition="above" sliderType="linear" id="346"/> + <connections> + <action selector="previewScrubberChanged:" target="-2" id="384"/> + </connections> + </slider> + <button toolTip="Toggle Play/Pause" id="361"> + <rect key="frame" x="207" y="44" width="36" height="36"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> + <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="play-p" imagePosition="only" alignment="center" alternateImage="pause-p" imageScaling="proportionallyDown" id="362"> + <behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <action selector="toggleMoviePreviewPlayPause:" target="-2" id="370"/> + </connections> + </button> + <button toolTip="Go To Beginning" id="375"> + <rect key="frame" x="165" y="49" width="32" height="26"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> + <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="prev-p" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" id="376"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <action selector="moviePlaybackGoToBeginning:" target="-2" id="382"/> + </connections> + </button> + <button toolTip="Go To End" id="378"> + <rect key="frame" x="253" y="49" width="32" height="26"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> + <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="next-p" imagePosition="only" alignment="center" controlSize="mini" imageScaling="proportionallyDown" id="379"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="miniSystem"/> + </buttonCell> + <connections> + <action selector="moviePlaybackGoToEnd:" target="-2" id="383"/> + </connections> + </button> + <button toolTip="Show Still Previews" verticalHuggingPriority="750" id="365"> + <rect key="frame" x="350" y="54" width="81" height="16"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <buttonCell key="cell" type="push" title="Still Previews" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="366"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="miniSystem"/> + </buttonCell> + <connections> + <action selector="showPicturesPreview:" target="-2" id="396"/> + </connections> + </button> + <textField verticalHuggingPriority="750" id="372"> + <rect key="frame" x="349" y="20" width="94" height="14"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> + <textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="right" title="00:00:00" id="373"> + <font key="font" metaFont="smallSystemBold"/> + <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + </textField> + </subviews> + </customView> + <customView hidden="YES" id="F8A-dU-Y1l" userLabel="Encoding Controls" customClass="HBHUDView"> + <rect key="frame" x="15" y="240" width="460" height="100"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> - <view key="contentView"> - <rect key="frame" x="2" y="2" width="456" height="96"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <progressIndicator verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" controlSize="small" style="bar" id="213"> - <rect key="frame" x="18" y="26" width="346" height="12"/> - <autoresizingMask key="autoresizingMask"/> - </progressIndicator> - <button toolTip="Cancel Live Preview Encode" verticalHuggingPriority="750" id="261"> - <rect key="frame" x="381" y="24" width="58" height="16"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/> - <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="262"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> - <font key="font" metaFont="miniSystem"/> - </buttonCell> - <connections> - <action selector="cancelCreateMoviePreview:" target="-2" id="395"/> - </connections> - </button> - <textField verticalHuggingPriority="750" id="223"> - <rect key="frame" x="15" y="59" width="406" height="14"/> - <autoresizingMask key="autoresizingMask"/> - <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Preparing Preview" id="224"> - <font key="font" metaFont="smallSystemBold"/> - <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> - <color key="backgroundColor" red="0.90196085000000004" green="0.90196085000000004" blue="0.90196085000000004" alpha="0.0" colorSpace="deviceRGB"/> - </textFieldCell> - </textField> - </subviews> - </view> - <color key="borderColor" red="1" green="1" blue="1" alpha="0.80000000000000004" colorSpace="calibratedRGB"/> - <color key="fillColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="calibratedRGB"/> - </box> + <subviews> + <textField verticalHuggingPriority="750" id="223"> + <rect key="frame" x="17" y="60" width="425" height="14"/> + <autoresizingMask key="autoresizingMask"/> + <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Preparing Preview" id="224"> + <font key="font" metaFont="smallSystemBold"/> + <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + <color key="backgroundColor" red="0.90196085000000004" green="0.90196085000000004" blue="0.90196085000000004" alpha="0.0" colorSpace="deviceRGB"/> + </textFieldCell> + </textField> + <progressIndicator verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" controlSize="small" style="bar" id="213"> + <rect key="frame" x="20" y="27" width="346" height="12"/> + <autoresizingMask key="autoresizingMask"/> + </progressIndicator> + <button toolTip="Cancel Live Preview Encode" verticalHuggingPriority="750" id="261"> + <rect key="frame" x="383" y="25" width="58" height="16"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/> + <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="mini" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="262"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="miniSystem"/> + </buttonCell> + <connections> + <action selector="cancelCreateMoviePreview:" target="-2" id="395"/> + </connections> + </button> + </subviews> + </customView> </subviews> </view> </window> diff --git a/macosx/HBHUDView.h b/macosx/HBHUDView.h new file mode 100644 index 000000000..9cea11ac4 --- /dev/null +++ b/macosx/HBHUDView.h @@ -0,0 +1,15 @@ +// +// HBVisualEffectBox.h +// HandBrake +// +// Created by Toby on 21/08/14. +// +// + +#import <Cocoa/Cocoa.h> + +/** + * The HBHUDView class implements simple views that can draw the background in the HUD style. + */ +@interface HBHUDView : NSView +@end diff --git a/macosx/HBHUDView.m b/macosx/HBHUDView.m new file mode 100644 index 000000000..769c5ba99 --- /dev/null +++ b/macosx/HBHUDView.m @@ -0,0 +1,95 @@ +// +// HBVisualEffectBox.m +// HandBrake +// +// Created by Toby on 21/08/14. +// +// + +#import "HBHUDView.h" + +@interface NSView (HBHUDViewExtension) + +- (void)setBlendingMode:(int)mode; +- (void)setMaterial:(int)material; +- (void)setState:(int)state; + +@end + +@implementation HBHUDView + +- (instancetype)init +{ + self = [super init]; + if (self) + { + [self setupOldStyleHUD]; + } + + return self; +} + ++ (void)setupNewStyleHUD:(NSView *)view +{ + [view setWantsLayer:YES]; + [view.layer setCornerRadius:4]; + + // Hardcode the values so we can + // compile it with the 10.9 sdk. + [view setBlendingMode:1]; + [view setMaterial:2]; + [view setState:1]; + + [view setAppearance:[NSAppearance appearanceNamed:@"NSAppearanceNameVibrantDark"]]; +} + +- (void)setupOldStyleHUD +{ + [self setWantsLayer:YES]; + [self.layer setCornerRadius:14]; + + // Black transparent background and white border + CGColorRef white = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 0.9); + [self.layer setBorderColor:white]; + CFRelease(white); + [self.layer setBorderWidth:2]; + + CGColorRef black = CGColorCreateGenericRGB(0.0, 0.0, 0.0, 0.6); + [self.layer setBackgroundColor:black]; + CFRelease(black); +} + +- (instancetype)initWithFrame:(NSRect)frame +{ + if (NSClassFromString(@"NSVisualEffectView")) + { + // Return a NSVisualEffectView instance + self = [[NSClassFromString(@"NSVisualEffectView") alloc] initWithFrame:frame]; + if (self) + { + [HBHUDView setupNewStyleHUD:self]; + } + } + else + { + self = [super initWithFrame:frame]; + if (self) + { + [self setupOldStyleHUD]; + } + } + + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) + { + [self setupOldStyleHUD]; + } + return self; +} + +@end
\ No newline at end of file diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m index d13254ddc..c92bc4e8f 100644 --- a/macosx/HBPreviewController.m +++ b/macosx/HBPreviewController.m @@ -56,10 +56,10 @@ #define BORDER_SIZE 2.0 // make min width and height of preview window large enough for hud -#define MIN_WIDTH 460.0 -#define MIN_HEIGHT 128.0 +#define MIN_WIDTH 480.0 +#define MIN_HEIGHT 360.0 -#define ANIMATION_DUR 0.2 +#define ANIMATION_DUR 0.15 typedef enum ViewMode : NSUInteger { ViewModePicturePreview, @@ -70,9 +70,9 @@ typedef enum ViewMode : NSUInteger { @interface HBPreviewController () <HBPreviewGeneratorDelegate> { /* HUD boxes */ - IBOutlet NSBox * fPictureControlBox; - IBOutlet NSBox * fEncodingControlBox; - IBOutlet NSBox * fMoviePlaybackControlBox; + IBOutlet NSView * fPictureControlBox; + IBOutlet NSView * fEncodingControlBox; + IBOutlet NSView * fMoviePlaybackControlBox; IBOutlet NSSlider * fPictureSlider; IBOutlet NSTextField * fInfoField; @@ -185,9 +185,6 @@ typedef enum ViewMode : NSUInteger { /* Setup our layers for core animation */ [[[self window] contentView] setWantsLayer:YES]; - [fPictureControlBox setWantsLayer:YES]; - [fEncodingControlBox setWantsLayer:YES]; - [fMoviePlaybackControlBox setWantsLayer:YES]; self.backLayer = [CALayer layer]; [self.backLayer setBounds:CGRectMake(0.0, 0.0, MIN_WIDTH, MIN_HEIGHT)]; @@ -442,7 +439,15 @@ typedef enum ViewMode : NSUInteger { [[NSAnimationContext currentContext] setDuration:ANIMATION_DUR]; [boxes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [[obj animator] setHidden:([indexes containsIndex:idx]) ? NO : YES]; + BOOL hide = [indexes containsIndex:idx] ? NO : YES; + if (hide) + { + [self hideHudWithAnimation:obj]; + } + else + { + [self showHudWithAnimation:obj]; + } }]; [NSAnimationContext endGrouping]; @@ -545,33 +550,81 @@ typedef enum ViewMode : NSUInteger { /* Since we are not encoding, verify which control hud to show * or hide based on aMovie ( aMovie indicates we need movie controls ) */ - NSBox *hudBoxToShow; + NSView *hud; if (self.currentViewMode == !ViewModeMoviePreview) // No movie loaded up { - hudBoxToShow = fPictureControlBox; + hud = fPictureControlBox; } else // We have a movie { - hudBoxToShow = fMoviePlaybackControlBox; + hud = fMoviePlaybackControlBox; } - if (NSPointInRect(mouseLoc, [hudBoxToShow frame])) + if (NSPointInRect(mouseLoc, [hud frame])) { - [[hudBoxToShow animator] setHidden: NO]; + [self showHudWithAnimation:hud]; [self stopHudTimer]; } else if (NSPointInRect(mouseLoc, [[[self window] contentView] frame])) { - [[hudBoxToShow animator] setHidden: NO]; + [self showHudWithAnimation:hud]; [self startHudTimer]; } else { - [[hudBoxToShow animator] setHidden: YES]; + [self hideHudWithAnimation:hud]; + [self stopHudTimer]; } } } +- (void)showHudWithAnimation:(NSView *)hud +{ + // The standard view animator doesn't play + // nicely with the Yosemite visual effects yet. + // So let's do the fade ourself. + if (hud.layer.opacity == 0 || [hud isHidden]) + { + [hud setHidden:NO]; + + [CATransaction begin]; + CABasicAnimation *fadeInAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + fadeInAnimation.fromValue = @(0.0); + fadeInAnimation.toValue = @(1.0); + fadeInAnimation.beginTime = 0.0; + fadeInAnimation.duration = ANIMATION_DUR; + + [hud.layer addAnimation:fadeInAnimation forKey:nil]; + [hud.layer setOpacity:1]; + + [CATransaction commit]; + } +} + +- (void)hideHudWithAnimation:(NSView *)hud +{ + if (hud.layer.opacity != 0) + { + [CATransaction begin]; + [CATransaction setCompletionBlock:^{ + if (hud.layer.opacity == 0) + { + [hud setHidden:YES]; + } + }]; + CABasicAnimation *fadeInAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + fadeInAnimation.fromValue = @([hud.layer.presentationLayer opacity]); + fadeInAnimation.toValue = @(0.0); + fadeInAnimation.beginTime = 0.0; + fadeInAnimation.duration = ANIMATION_DUR; + + [hud.layer addAnimation:fadeInAnimation forKey:nil]; + [hud.layer setOpacity:0]; + + [CATransaction commit]; + } +} + - (void) startHudTimer { if (self.hudTimer) @@ -596,8 +649,9 @@ typedef enum ViewMode : NSUInteger { /* Regardless which control box is active, after the timer * period we want either one to fade to hidden. */ - [[fPictureControlBox animator] setHidden: YES]; - [[fMoviePlaybackControlBox animator] setHidden: YES]; + [self hideHudWithAnimation:fPictureControlBox]; + [self hideHudWithAnimation:fMoviePlaybackControlBox]; + [self stopHudTimer]; } diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index e49b41683..4676704df 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -129,6 +129,7 @@ A9AA447A1970664A00D7DEFC /* HBUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AA44791970664A00D7DEFC /* HBUtilities.m */; }; A9BB0F2719A0ECE40079F1C1 /* HBHUDButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A9BB0F2619A0ECE40079F1C1 /* HBHUDButtonCell.m */; }; A9C0DB85197E7B0000DF55B3 /* SubtitlesDefaults.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C0DB83197E7B0000DF55B3 /* SubtitlesDefaults.xib */; }; + A9C9F88919A733FE00DC8923 /* HBHUDView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C9F88819A733FE00DC8923 /* HBHUDView.m */; }; A9CF25F11990D62C0023F727 /* Presets.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9CF25EF1990D62C0023F727 /* Presets.xib */; }; A9CF25F41990D64E0023F727 /* HBPreset.m in Sources */ = {isa = PBXBuildFile; fileRef = A9CF25F31990D64E0023F727 /* HBPreset.m */; }; A9CF25F71990D6820023F727 /* HBPresetsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9CF25F61990D6820023F727 /* HBPresetsViewController.m */; }; @@ -352,6 +353,8 @@ A9BB0F2519A0ECE40079F1C1 /* HBHUDButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBHUDButtonCell.h; sourceTree = "<group>"; }; A9BB0F2619A0ECE40079F1C1 /* HBHUDButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBHUDButtonCell.m; sourceTree = "<group>"; }; A9C0DB84197E7B0000DF55B3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = SubtitlesDefaults.xib; sourceTree = "<group>"; }; + A9C9F88719A733FE00DC8923 /* HBHUDView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBHUDView.h; sourceTree = "<group>"; }; + A9C9F88819A733FE00DC8923 /* HBHUDView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBHUDView.m; sourceTree = "<group>"; }; A9CF25F01990D62C0023F727 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Presets.xib; sourceTree = "<group>"; }; A9CF25F21990D64E0023F727 /* HBPreset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBPreset.h; sourceTree = "<group>"; }; A9CF25F31990D64E0023F727 /* HBPreset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPreset.m; sourceTree = "<group>"; }; @@ -846,6 +849,8 @@ 273F209A14ADBE670021BE6D /* HBImageAndTextCell.m */, A9BB0F2519A0ECE40079F1C1 /* HBHUDButtonCell.h */, A9BB0F2619A0ECE40079F1C1 /* HBHUDButtonCell.m */, + A9C9F88719A733FE00DC8923 /* HBHUDView.h */, + A9C9F88819A733FE00DC8923 /* HBHUDView.m */, ); name = "UI Views"; sourceTree = "<group>"; @@ -1065,6 +1070,7 @@ A9CF25F71990D6820023F727 /* HBPresetsViewController.m in Sources */, 273F20BE14ADC09F0021BE6D /* main.mm in Sources */, A91726E7197291BC00D1AFEF /* HBChapterTitlesController.m in Sources */, + A9C9F88919A733FE00DC8923 /* HBHUDView.m in Sources */, A932E26F198833920047D13E /* HBAudioDefaultsController.m in Sources */, 46AB433515F98A2B009C0961 /* DockTextField.m in Sources */, A9D488A51996270300E9B1BA /* HBTreeNode.m in Sources */, |