Browse Source

【综合】波浪线优化

tangchao 7 months ago
parent
commit
9082f13f2b

+ 4 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.swift

@@ -1725,9 +1725,12 @@ let KMColorPickerViewHeight: CGFloat = 64
                                 } else if type == .strikeOut {
                                     KMPreferenceManager.shared.markupStrikthroughColor = textColor.withAlphaComponent(opacity)
                                 } else if type == .squiggly {
-//                                    KMPreferenceManager.shared
                                     UserDefaults.standard.setPDFListViewColor(textColor.withAlphaComponent(opacity), forKey: CSquigglyNoteColorKey)
                                     UserDefaults.standard.synchronize()
+                                    
+                                    // 发通知
+                                    let theColor = KMPreferenceManager.shared.markupHighlightColor
+                                    KMPreferenceManager.shared.markupHighlightColor = theColor
                                 } else if type == .ink {
                                     KMPreferenceManager.shared.markupPenColor = textColor.withAlphaComponent(opacity)
                                 }

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -1665,7 +1665,7 @@ extension KMToolbarViewController {
         } else if identifier == KMToolbarSquigglyAnnotationItemIdentifier {
             item?.titleName = NSLocalizedString("", comment: "")
             let imageV = KMNoteTypeImageView()
-            let color = UserDefaults.standard.PDFListViewColor(forKey: CStrikeOutNoteColorKey) ?? .red
+            let color = UserDefaults.standard.PDFListViewColor(forKey: CSquigglyNoteColorKey) ?? .red
             item?.image = imageV.noteTypeImage(withType: "squiggly", color: color)
             item?.target = self
             item?.btnTag = CAnnotationType.squiggly.rawValue

+ 9 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -92,6 +92,15 @@ extension KMMainViewController {
                     item.image = imageV.noteTypeImage(withType: SKNHighlightString, color: color)
                 }
             }
+            
+            if let item = self.toolbarController.findItem(KMToolbarSquigglyAnnotationItemIdentifier) {
+                if item.isSelected {
+                    if let color = UserDefaults.standard.PDFListViewColor(forKey: CSquigglyNoteColorKey) {
+                        let imageV = KMNoteTypeImageView()
+                        item.image = imageV.noteTypeImage(withType: "squiggly", color: color)
+                    }
+                }
+            }
         }
         if info.keys.contains(KMPreference.markupColorUnderlineKey) {
             if let item = self.toolbarController.findItem(KMToolbarUnderlineAnnotationItemIdentifier) {