|
@@ -72,6 +72,8 @@ class KMNPopAnnotationViewController: KMNBaseViewController {
|
|
|
operationBox.contentView = shapeView
|
|
|
|
|
|
congfigShapePopUI()
|
|
|
+
|
|
|
+ updateShapeWidthButtonState()
|
|
|
break
|
|
|
case .linkAnnotation:
|
|
|
if let newLinkAnnotation = annotationPopMode.annotation as? CPDFLinkAnnotation {
|
|
@@ -638,6 +640,44 @@ class KMNPopAnnotationViewController: KMNBaseViewController {
|
|
|
generaColorGroup.delegate = self
|
|
|
}
|
|
|
|
|
|
+ private func updateShapeWidthButtonState() {
|
|
|
+ let annotations = annotationPopMode.annotations
|
|
|
+ var isNoHaveZoomOut = true
|
|
|
+ var isNoHaveZoomIn = true
|
|
|
+
|
|
|
+ for i in 0 ..< annotations.count {
|
|
|
+ let annotation = annotations[i]
|
|
|
+ var shapeWidth = annotation.borderWidth
|
|
|
+ if annotation.isKind(of: CSelfSignAnnotation.self) == true {
|
|
|
+ if let signAnnotation:CSelfSignAnnotation = annotation as? CSelfSignAnnotation {
|
|
|
+ shapeWidth = signAnnotation.lineAnnotationWidth
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if shapeWidth < minLineValue {
|
|
|
+ isNoHaveZoomOut = false
|
|
|
+ }
|
|
|
+
|
|
|
+ if shapeWidth > maxLineValue {
|
|
|
+ isNoHaveZoomIn = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if isNoHaveZoomOut == false {
|
|
|
+ widthZoomOutButton.properties.state = .pressed
|
|
|
+ } else {
|
|
|
+ widthZoomOutButton.properties.state = .normal
|
|
|
+ }
|
|
|
+ widthZoomOutButton.reloadData()
|
|
|
+
|
|
|
+ if isNoHaveZoomIn == false {
|
|
|
+ widthZoomInButton.properties.state = .pressed
|
|
|
+ } else {
|
|
|
+ widthZoomInButton.properties.state = .normal
|
|
|
+ }
|
|
|
+ widthZoomOutButton.reloadData()
|
|
|
+ }
|
|
|
+
|
|
|
private func congfigFontPopUI() {
|
|
|
fontNameSelect.properties = ComponentSelectProperties(size: .s,
|
|
|
state: .normal,
|
|
@@ -831,12 +871,14 @@ class KMNPopAnnotationViewController: KMNBaseViewController {
|
|
|
if annotationPopMode.zoomOutShapeWidth() {
|
|
|
updatePDFViewCallback?()
|
|
|
}
|
|
|
+ updateShapeWidthButtonState()
|
|
|
}
|
|
|
|
|
|
@objc func widthZoomInButtonClicked(_ sender: NSView) {
|
|
|
if annotationPopMode.zoomInShapeWidth() {
|
|
|
updatePDFViewCallback?()
|
|
|
}
|
|
|
+ updateShapeWidthButtonState()
|
|
|
}
|
|
|
|
|
|
@objc func pageLinkButtonClicked(_ sender: NSView) {
|