|
@@ -17,7 +17,7 @@ import KMComponentLibrary
|
|
|
@objc optional func kmCropControllerDidCropAuto(_ controller: KMCropPropertyController, _ view: KMPageRangeSelectView)
|
|
|
}
|
|
|
|
|
|
-class KMCropPropertyController: NSViewController {
|
|
|
+class KMCropPropertyController: KMNBaseViewController {
|
|
|
|
|
|
@IBOutlet var contendView: NSView!
|
|
|
|
|
@@ -78,6 +78,18 @@ class KMCropPropertyController: NSViewController {
|
|
|
reloadData()
|
|
|
}
|
|
|
|
|
|
+ override func updateUILanguage() {
|
|
|
+ super.updateUILanguage()
|
|
|
+
|
|
|
+ refreshUI()
|
|
|
+ }
|
|
|
+
|
|
|
+ override func updateUIThemeColor() {
|
|
|
+ super.updateUIThemeColor()
|
|
|
+
|
|
|
+ refreshUI()
|
|
|
+ }
|
|
|
+
|
|
|
//MARK: - Setter and Getter
|
|
|
|
|
|
public var syncChangeBounds : Bool {
|
|
@@ -112,34 +124,13 @@ class KMCropPropertyController: NSViewController {
|
|
|
}
|
|
|
|
|
|
func setupProperty() {
|
|
|
- //White Margin
|
|
|
- whiteMarginLabel.stringValue = KMLocalizedString("Crop White Margins")
|
|
|
- whiteMarginLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
|
|
|
- whiteMarginLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
|
|
|
-
|
|
|
- separateLabel.stringValue = KMLocalizedString("Separate")
|
|
|
- separateLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-form/colorText-label")
|
|
|
- separateLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-regular")
|
|
|
-
|
|
|
separateSwitch.properties = ComponentSwitchProperty(size: .s, open: false, isDisabled: false)
|
|
|
separateSwitch.setTarget(self, action: #selector(switchAction(_:)))
|
|
|
|
|
|
- autoLabel.stringValue = KMLocalizedString("Auto")
|
|
|
- autoLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-form/colorText-label")
|
|
|
- autoLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-regular")
|
|
|
-
|
|
|
- separateTip.toolTip = KMLocalizedString("separateTip tooltips")
|
|
|
-
|
|
|
- autoTipsView.toolTip = KMLocalizedString("autoTipsView tooltips")
|
|
|
|
|
|
autoSwitch.properties = ComponentSwitchProperty(size: .s, open: false, isDisabled: false)
|
|
|
autoSwitch.setTarget(self, action: #selector(switchAction(_:)))
|
|
|
|
|
|
- //PageSize
|
|
|
- whiteMarginLabel.stringValue = KMLocalizedString("Crop Page Size")
|
|
|
- whiteMarginLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
|
|
|
- whiteMarginLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
|
|
|
-
|
|
|
sizeSyncButton.properties = ComponentButtonProperty(type: .text_gray, size: .xxs, onlyIcon: true, icon: NSImage(named: "sync_Change_unlock"), keepPressState: true)
|
|
|
sizeSyncButton.properties.propertyInfo.leftIcon_press = NSImage(named: "sync_Change_lock")
|
|
|
sizeSyncButton.setTarget(self, action: #selector(sizeSyncButtonClicked(_:)))
|
|
@@ -165,11 +156,6 @@ class KMCropPropertyController: NSViewController {
|
|
|
text:"100")
|
|
|
sizeHeightInput.delegate = self
|
|
|
|
|
|
- //PageMargin
|
|
|
- whiteMarginLabel.stringValue = KMLocalizedString("Crop Page Margins")
|
|
|
- whiteMarginLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
|
|
|
- whiteMarginLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
|
|
|
-
|
|
|
pageLeftInput.properties = ComponentInputNumberProperty(size: .s,
|
|
|
state: .normal,
|
|
|
minSize: 0,
|
|
@@ -198,14 +184,63 @@ class KMCropPropertyController: NSViewController {
|
|
|
pageTopInput.delegate = self
|
|
|
pageRightInput.delegate = self
|
|
|
pageBottomInput.delegate = self
|
|
|
+
|
|
|
+ cropButton.properties = ComponentButtonProperty(type: .primary, size: .m, buttonText: KMLocalizedString("Apply"), keepPressState: false)
|
|
|
+ cropButton.setTarget(self, action: #selector(cropButtonClicked(_:)))
|
|
|
+
|
|
|
+ refreshUI()
|
|
|
+ }
|
|
|
+
|
|
|
+ func refreshUI() {
|
|
|
+ //White Margin
|
|
|
+ whiteMarginLabel.stringValue = KMLocalizedString("Crop White Margins")
|
|
|
+ whiteMarginLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
|
|
|
+ whiteMarginLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
|
|
|
+
|
|
|
+ separateLabel.stringValue = KMLocalizedString("Separate")
|
|
|
+ separateLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-form/colorText-label")
|
|
|
+ separateLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-regular")
|
|
|
+
|
|
|
+ autoLabel.stringValue = KMLocalizedString("Auto")
|
|
|
+ autoLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("comp-form/colorText-label")
|
|
|
+ autoLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-regular")
|
|
|
+
|
|
|
+ separateTip.toolTip = KMLocalizedString("separateTip tooltips")
|
|
|
+
|
|
|
+ autoTipsView.toolTip = KMLocalizedString("autoTipsView tooltips")
|
|
|
+
|
|
|
+
|
|
|
+ //PageSize
|
|
|
+ whiteMarginLabel.stringValue = KMLocalizedString("Crop Page Size")
|
|
|
+ whiteMarginLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
|
|
|
+ whiteMarginLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
|
|
|
+
|
|
|
+
|
|
|
+ //PageMargin
|
|
|
+ whiteMarginLabel.stringValue = KMLocalizedString("Crop Page Margins")
|
|
|
+ whiteMarginLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
|
|
|
+ whiteMarginLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
|
|
|
|
|
|
//PageRange
|
|
|
pageRangeLabel.stringValue = KMLocalizedString("Page Range")
|
|
|
pageRangeLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2")
|
|
|
pageRangeLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-s-medium")
|
|
|
|
|
|
- cropButton.properties = ComponentButtonProperty(type: .primary, size: .m, buttonText: KMLocalizedString("Apply"), keepPressState: false)
|
|
|
- cropButton.setTarget(self, action: #selector(cropButtonClicked(_:)))
|
|
|
+ sizeSyncButton.properties = sizeSyncButton.properties
|
|
|
+
|
|
|
+ sizeWidthInput.properties = sizeWidthInput.properties
|
|
|
+
|
|
|
+ sizeHeightInput.properties = sizeHeightInput.properties
|
|
|
+
|
|
|
+ pageLeftInput.properties = pageLeftInput.properties
|
|
|
+
|
|
|
+ pageTopInput.properties = pageTopInput.properties
|
|
|
+
|
|
|
+ pageRightInput.properties = pageRightInput.properties
|
|
|
+
|
|
|
+ pageBottomInput.properties = pageBottomInput.properties
|
|
|
+
|
|
|
+ pangeRangeSelectView.refreshUI()
|
|
|
}
|
|
|
|
|
|
func reloadData() {
|