diff options
-rw-r--r-- | macosx/English.lproj/PictureSettings.xib | 41 | ||||
-rw-r--r-- | macosx/PictureController.m | 67 |
2 files changed, 94 insertions, 14 deletions
diff --git a/macosx/English.lproj/PictureSettings.xib b/macosx/English.lproj/PictureSettings.xib index 7f1f5cf09..858736fee 100644 --- a/macosx/English.lproj/PictureSettings.xib +++ b/macosx/English.lproj/PictureSettings.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="14A329r" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <dependencies> - <deployment version="1060" defaultVersion="1060" identifier="macosx"/> + <deployment version="1060" identifier="macosx"/> <development version="5100" identifier="xcode"/> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="HBPictureController"> @@ -50,7 +50,7 @@ </connections> </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> - <customObject id="-3" userLabel="Application"/> + <customObject id="-3" userLabel="Application" customClass="NSObject"/> <window title="Picture Settings" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="PictureSizing" animationBehavior="default" id="5" userLabel="PicturePanel" customClass="NSPanel"> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" utility="YES" HUD="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> @@ -74,10 +74,10 @@ </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="278"> - <rect key="frame" x="14" y="10" width="425" height="12"/> + <rect key="frame" x="14" y="8" width="418" height="14"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" alignment="left" id="279"> - <font key="font" metaFont="miniSystem"/> + <font key="font" metaFont="smallSystem"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/> </textFieldCell> @@ -165,7 +165,7 @@ <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="44"> <rect key="frame" x="143" y="103" width="15" height="22"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="59" id="169"> + <stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="64" id="169"> <font key="font" metaFont="smallSystem"/> </stepperCell> <connections> @@ -208,7 +208,7 @@ <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="46"> <rect key="frame" x="143" y="78" width="15" height="22"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="64" id="171"> + <stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="59" id="171"> <font key="font" metaFont="smallSystem"/> </stepperCell> <connections> @@ -331,10 +331,10 @@ </stepperCell> </stepper> <matrix verticalHuggingPriority="750" allowsEmptySelection="NO" autosizesCells="NO" id="16"> - <rect key="frame" x="64" y="92" width="81" height="31"/> + <rect key="frame" x="64" y="92" width="90" height="31"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> - <size key="cellSize" width="81" height="14"/> + <size key="cellSize" width="90" height="14"/> <size key="intercellSpacing" width="2" height="3"/> <buttonCell key="prototype" type="radio" title="Radio" imagePosition="left" alignment="left" controlSize="mini" inset="2" id="178" customClass="HBHUDButtonCell"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> @@ -359,20 +359,26 @@ <textField verticalHuggingPriority="750" id="13"> <rect key="frame" x="131" y="66" width="36" height="16"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="153"> + <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="153"> <font key="font" metaFont="miniSystem"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> + <connections> + <action selector="settingsChanged:" target="-2" id="LEd-0c-EqV"/> + </connections> </textField> <textField verticalHuggingPriority="750" id="10"> <rect key="frame" x="131" y="39" width="36" height="16"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="150"> + <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="150"> <font key="font" metaFont="miniSystem"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> + <connections> + <action selector="settingsChanged:" target="-2" id="txb-hc-ans"/> + </connections> </textField> <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="19"> <rect key="frame" x="110" y="50" width="15" height="22"/> @@ -387,20 +393,26 @@ <textField verticalHuggingPriority="750" id="9"> <rect key="frame" x="194" y="56" width="36" height="16"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="149"> + <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="149"> <font key="font" metaFont="miniSystem"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> + <connections> + <action selector="settingsChanged:" target="-2" id="FQT-HE-w3X"/> + </connections> </textField> <textField verticalHuggingPriority="750" id="11"> <rect key="frame" x="72" y="53" width="36" height="16"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> - <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="151"> + <textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="151"> <font key="font" metaFont="miniSystem"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> + <connections> + <action selector="settingsChanged:" target="-2" id="JTs-h7-4xm"/> + </connections> </textField> <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="14"> <rect key="frame" x="169" y="36" width="15" height="22"/> @@ -884,6 +896,7 @@ <connections> <outlet property="delegate" destination="-2" id="hby-dR-NFK"/> </connections> + <point key="canvasLocation" x="182.5" y="419"/> </window> </objects> </document> diff --git a/macosx/PictureController.m b/macosx/PictureController.m index fcf8af530..6fd2f4743 100644 --- a/macosx/PictureController.m +++ b/macosx/PictureController.m @@ -264,6 +264,11 @@ static void *HBPictureControllerContext = &HBPictureControllerContext; [fCropLeftStepper setEnabled: !self.autoCrop]; [fCropRightStepper setEnabled: !self.autoCrop]; + [fCropTopField setEditable: !self.autoCrop]; + [fCropBottomField setEditable: !self.autoCrop]; + [fCropLeftField setEditable: !self.autoCrop]; + [fCropRightField setEditable: !self.autoCrop]; + /* If auto, lets set the crop steppers according to * current fTitle->crop values */ memcpy( job->crop, fTitle->crop, 4 * sizeof( int ) ); @@ -697,6 +702,11 @@ static void *HBPictureControllerContext = &HBPictureControllerContext; [fCropBottomStepper setEnabled: !self.autoCrop]; [fCropLeftStepper setEnabled: !self.autoCrop]; [fCropRightStepper setEnabled: !self.autoCrop]; + + [fCropTopField setEditable: !self.autoCrop]; + [fCropBottomField setEditable: !self.autoCrop]; + [fCropLeftField setEditable: !self.autoCrop]; + [fCropRightField setEditable: !self.autoCrop]; } } if (sender == fCropTopStepper) @@ -724,6 +734,63 @@ static void *HBPictureControllerContext = &HBPictureControllerContext; [fWidthStepper setMaxValue: fTitle->width - job->crop[2] - job->crop[3]]; } + if (sender == fCropTopField) + { + int cropValue = [fCropTopField intValue]; + if (cropValue >= 0 && (cropValue <= fTitle->height/2-2)) + { + job->crop[0] = cropValue; + [fCropTopStepper setIntValue:cropValue]; + [fHeightStepper setMaxValue: fTitle->height - job->crop[0] - job->crop[1]]; + } + else + { + [fCropLeftField setIntValue:job->crop[0]]; + } + } + else if (sender == fCropBottomField) + { + int cropValue = [fCropBottomField intValue]; + if (cropValue >= 0 && (cropValue <= fTitle->height/2-2)) + { + job->crop[1] = cropValue; + [fCropBottomStepper setIntValue:cropValue]; + [fHeightStepper setMaxValue: fTitle->height - job->crop[0] - job->crop[1]]; + } + else + { + [fCropLeftField setIntValue:job->crop[1]]; + } + } + else if (sender == fCropLeftField) + { + int cropValue = [fCropLeftField intValue]; + if (cropValue >= 0 && (cropValue <= fTitle->width/2-2)) + { + job->crop[2] = cropValue; + [fCropLeftStepper setIntValue:cropValue]; + [fWidthStepper setMaxValue: fTitle->width - job->crop[2] - job->crop[3]]; + } + else + { + [fCropLeftField setIntValue:job->crop[2]]; + } + } + else if (sender == fCropRightField) + { + int cropValue = [fCropRightField intValue]; + if (cropValue >= 0 && (cropValue <= fTitle->width/2-2)) + { + job->crop[3] = cropValue; + [fCropRightStepper setIntValue:cropValue]; + [fWidthStepper setMaxValue: fTitle->width - job->crop[2] - job->crop[3]]; + } + else + { + [fCropLeftField setIntValue:job->crop[3]]; + } + } + keep |= !!job->anamorphic.keep_display_aspect * HB_KEEP_DISPLAY_ASPECT; hb_geometry_t srcGeo, resultGeo; |