|
@@ -127,6 +127,28 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
|
|
|
initLocalization()
|
|
|
|
|
|
refreshUI()
|
|
|
+
|
|
|
+ customVC1.fillColor = annotationModel.fontColor()
|
|
|
+ colorVC5.fillColor = annotationModel.color() ?? .clear
|
|
|
+
|
|
|
+ if (annotationModel.color() == nil) {
|
|
|
+ colorVC1.state = .Sel
|
|
|
+ } else if self.isTheSameColor(annotationModel.color(), anotherColor: self.colors[1]) {
|
|
|
+ colorVC2.state = .Sel
|
|
|
+ } else if self.isTheSameColor(annotationModel.color(), anotherColor: self.colors[2]) {
|
|
|
+ colorVC3.state = .Sel
|
|
|
+ } else if self.isTheSameColor(annotationModel.color(), anotherColor: self.colors[3]) {
|
|
|
+ colorVC4.state = .Sel
|
|
|
+ }
|
|
|
+ if (annotationModel.alignment() == .left) {
|
|
|
+ leftVC.state = .Sel
|
|
|
+ } else if (annotationModel.alignment() == .center) {
|
|
|
+ centerVC.state = .Sel
|
|
|
+ } else if (annotationModel.alignment() == .right) {
|
|
|
+ rightVC.state = .Sel
|
|
|
+ }
|
|
|
+ self.opacitySlider.floatValue = Float(self.annotationModel.opacity())
|
|
|
+ self.opacityVC.stringValue = String(format: "%f", self.annotationModel.opacity())
|
|
|
}
|
|
|
|
|
|
func initializeUI() {
|
|
@@ -281,14 +303,12 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
|
|
|
|
|
|
func refreshUI() -> Void {
|
|
|
previewImageView.image = annotationModel.annotationImage
|
|
|
- customVC1.fillColor = annotationModel.fontColor()
|
|
|
|
|
|
if annotationModel.annotationType == .signDate {
|
|
|
colorVC1.fillColor = self.colors[0]
|
|
|
colorVC2.fillColor = self.colors[1]
|
|
|
colorVC3.fillColor = self.colors[2]
|
|
|
colorVC4.fillColor = self.colors[3]
|
|
|
- colorVC5.fillColor = annotationModel.color() ?? .clear
|
|
|
|
|
|
let includeTime = self.annotationModel.includeTime()
|
|
|
dateTypeVC.addItems(withObjectValues: KMSelfSignAnnotationFreeText.fetchAllDateString(includeTime) as! [String])
|
|
@@ -384,21 +404,29 @@ class KMFillSignTextPanel: KMPropertiesPanelSubViewController {
|
|
|
NSColorPanel.shared.setTarget(nil)
|
|
|
NSColorPanel.shared.setTarget(self)
|
|
|
NSColorPanel.shared.showsAlpha = true
|
|
|
- NSColorPanel.shared.setAction(#selector(colorPanelAction(_:)))
|
|
|
- NSColorPanel.shared.orderFront(nil)
|
|
|
- }
|
|
|
-
|
|
|
- @IBAction func colorPanelAction(_ sender: NSButton) {
|
|
|
if (sender == customVC2.button) {
|
|
|
- annotationModel.setFontColor(NSColorPanel.shared.color)
|
|
|
+ NSColorPanel.shared.setAction(#selector(colorPanelAction1(_:)))
|
|
|
} else if (sender == fillCustomVC.button) {
|
|
|
- annotationModel.setColor(NSColorPanel.shared.color)
|
|
|
+ NSColorPanel.shared.setAction(#selector(colorPanelAction2(_:)))
|
|
|
}
|
|
|
+ NSColorPanel.shared.orderFront(nil)
|
|
|
+ }
|
|
|
+
|
|
|
+ @IBAction func colorPanelAction1(_ sender: NSColorPanel) {
|
|
|
+ annotationModel.setFontColor(sender.color)
|
|
|
+ customVC1.fillColor = annotationModel.fontColor()
|
|
|
|
|
|
refreshUI()
|
|
|
updateAnnotation()
|
|
|
}
|
|
|
|
|
|
+ @IBAction func colorPanelAction2(_ sender: NSColorPanel) {
|
|
|
+ annotationModel.setColor(sender.color)
|
|
|
+ colorVC5.fillColor = annotationModel.color() ?? .clear
|
|
|
+
|
|
|
+ refreshUI()
|
|
|
+ updateAnnotation()
|
|
|
+ }
|
|
|
@IBAction func showOpacityView(_ sender: NSButton) {
|
|
|
if (fillColorSubBox.contentView == self.opacityView) {
|
|
|
fillColorSubBox.contentView = fillColorSubView
|