summaryrefslogtreecommitdiffstats
path: root/macosx/PictureController.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/PictureController.m')
-rw-r--r--macosx/PictureController.m67
1 files changed, 67 insertions, 0 deletions
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;