|
@@ -406,7 +406,7 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
}
|
|
|
// NotificationCenter.default.addObserver(self, selector: #selector(alignmentTypeNotification(_:)), name: "KMAnnotationAlignmentTypeNotification1", object: nil)
|
|
|
// NotificationCenter.default.addObserver(self, selector: #selector(loadingUIAndLocalization(_:)), name: "KMPreferenceDidChangeNotificationName", object: nil)
|
|
|
-// NotificationCenter.default.addObserver(self, selector: #selector(annotationChangeNotification(_:)), name: CPDFListViewAnnotationsAttributeHasChangeNotification, object: nil)
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(annotationChangeNotification(_:)), name: NSNotification.Name(rawValue: "CPDFListViewAnnotationsAttributeHasChangeNotification"), object: nil)
|
|
|
}
|
|
|
|
|
|
override func viewDidLoad() {
|
|
@@ -2309,6 +2309,16 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
updateViewColor()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @objc func annotationChangeNotification(_ notification: NSNotification) {
|
|
|
+ if notification.object != nil {
|
|
|
+ let anno: [String : Any] = notification.object as! [String : Any]
|
|
|
+ let textAnno: CPDFAnnotation = anno["object"] as! CPDFAnnotation
|
|
|
+ if textAnno.isKind(of: CPDFTextAnnotation.self) {
|
|
|
+ textColorPickerView.setColor(textAnno.color)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class KMGeneralAnnotationColorButton: NSButton {
|