|
@@ -195,16 +195,16 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
self.whVC?.image = NSImage(named: "KMImageNameEditPDFWhExchange")!
|
|
|
self.whVC?.image_act = NSImage(named: "KMImageNameEditPDFWhExchangeSelected")!
|
|
|
self.whVC?.pagination()
|
|
|
- whVC?.borderColor_hov = KMAppearance.Interactive.s0Color()
|
|
|
- whVC?.borderColor_act = KMAppearance.Interactive.s0Color()
|
|
|
- whVC?.borderColor_disabled = KMAppearance.Interactive.s0Color()
|
|
|
+// whVC?.borderColor_hov = KMAppearance.Interactive.s0Color()
|
|
|
+// whVC?.borderColor_act = KMAppearance.Interactive.s0Color()
|
|
|
+// whVC?.borderColor_disabled = KMAppearance.Interactive.s0Color()
|
|
|
whVC?.cornerRadius = 4
|
|
|
whVC?.cornerRadius_hov = 4
|
|
|
- whVC?.cornerRadius_act = 4
|
|
|
+// whVC?.cornerRadius_act = 4
|
|
|
whVC?.cornerRadius_disabled = 4
|
|
|
whVC?.background_hov = KMAppearance.view_bg_dis_color()
|
|
|
whVC?.background_focus = KMAppearance.Layout.l1Color()
|
|
|
- whVC?.background_act = KMAppearance.buttonSelectedColor()
|
|
|
+// whVC?.background_act = KMAppearance.buttonSelectedColor()
|
|
|
whVC?.background_disabled = KMAppearance.buttonDisabledColor()
|
|
|
self.whVC?.toolTip = NSLocalizedString("Keep Proportions", comment: "")
|
|
|
self.whVC?.state = self._getKeepProportionsButtonState() ? .Act : .Norm
|
|
@@ -513,7 +513,7 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
self.turnOverBox.isHidden = false
|
|
|
self.opacityTitleLabel.isHidden = false
|
|
|
|
|
|
- self.whVC?.state = .Disabled
|
|
|
+ self._updateWHProportionButtonEnableState()
|
|
|
self.cropVC?.state = .Disabled
|
|
|
self.replaceVC?.state = .Disabled
|
|
|
|
|
@@ -660,6 +660,8 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // MARK: - Private Methods
|
|
|
+
|
|
|
private func changeAreasAlign(areas:[Any],newBounds:[String]) {
|
|
|
var oldBounds : [String] = []
|
|
|
for i in 0 ... areas.count-1 {
|
|
@@ -682,6 +684,16 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
return state as? Bool ?? defaultV
|
|
|
}
|
|
|
|
|
|
+ private func _updateWHProportionButtonEnableState() {
|
|
|
+ let wEqual = self.handdler?.editAreasBoundsIsEqualForWidth() ?? false
|
|
|
+ let hEqual = self.handdler?.editAreasBoundsIsEqualForHeight() ?? false
|
|
|
+ if (wEqual && hEqual) {
|
|
|
+ self.whVC?.state = self._getKeepProportionsButtonState() ? .Act : .Norm
|
|
|
+ } else {
|
|
|
+ self.whVC?.state = .Disabled
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private func _trackEvent() {
|
|
|
kTrackEventManager.trackEvent(event: "SubTbr_EditPDF", withProperties: ["SubTbr_EditImage":"SubTbr_EditImage_PropertiesPanel_All"])
|
|
|
}
|
|
@@ -968,6 +980,10 @@ extension KMEditImagePropertyViewController: KMTextFieldDelegate {
|
|
|
|
|
|
self.listView.setBoundsEditArea(area, withBounds: bounds)
|
|
|
}
|
|
|
+
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ self._updateWHProportionButtonEnableState()
|
|
|
+ }
|
|
|
} else if self.hTextFieldItemView.isEqual(to: textField) {
|
|
|
let number = NSNumber(value: Int(self.hTextFieldItemView.stringValue ?? "") ?? 0)
|
|
|
let string = self.hTextFieldItemView.textFiled.formatter?.string(for: number)
|
|
@@ -1010,6 +1026,10 @@ extension KMEditImagePropertyViewController: KMTextFieldDelegate {
|
|
|
|
|
|
self.listView.setBoundsEditArea(area, withBounds: bounds)
|
|
|
}
|
|
|
+
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ self._updateWHProportionButtonEnableState()
|
|
|
+ }
|
|
|
} else if self.rotateTextFieldItemView.isEqual(to: textField) {
|
|
|
// let stringValue = self.rotateTextFieldItemView.stringValue
|
|
|
// let number = NSNumber(value: Int(stringValue ?? "") ?? 0)
|