Ver código fonte

【fix】【注释】新增波浪线,右键菜单 & 菜单栏是否需要补充波浪线相关内容

tangchao 7 meses atrás
pai
commit
4611f5f59b

+ 6 - 0
PDF Office/PDF Master/Base.lproj/Main.storyboard

@@ -774,6 +774,12 @@ CA
                                                 <action selector="menuItemAction_deleteLine:" target="Ady-hI-5gd" id="bjk-Ab-PIT"/>
                                             </connections>
                                         </menuItem>
+                                        <menuItem title="Wavy Line" id="ceW-np-teA">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="menuItemAction_wavyLine:" target="Ady-hI-5gd" id="4O0-RE-Vwe"/>
+                                            </connections>
+                                        </menuItem>
                                         <menuItem isSeparatorItem="YES" id="GqA-jN-zhH"/>
                                         <menuItem title="Freehand" id="Dru-oa-CRm">
                                             <modifierMask key="keyEquivalentModifierMask"/>

+ 11 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -220,6 +220,7 @@ extension KMMainViewController {
             _ = stypeMenu.addItem(withTitle: NSLocalizedString("Highlight", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 0)
             _ = stypeMenu.addItem(withTitle: NSLocalizedString("Underline", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 1)
             _ = stypeMenu.addItem(withTitle: NSLocalizedString("Strikethrough", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 2)
+            _ = stypeMenu.addItem(withTitle: NSLocalizedString("Wavy Line", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 2)
             stypeMenu.addItem(NSMenuItem.separator())
         }
         //        stypeMenu.addItem(withTitle: NSLocalizedString("Freehand", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 0)
@@ -279,6 +280,7 @@ extension KMMainViewController {
         _ = stypeMenu.addItem(withTitle: NSLocalizedString("Highlight", comment: ""), action: #selector(changeAnnotationMode_itemAction), target: self, tag:  CAnnotationType.highlight.rawValue)
         _ = stypeMenu.addItem(withTitle: NSLocalizedString("Underline", comment: ""), action: #selector(changeAnnotationMode_itemAction), target: self, tag: CAnnotationType.underline.rawValue)
         _ = stypeMenu.addItem(withTitle: NSLocalizedString("Strikethrough", comment: ""), action: #selector(changeAnnotationMode_itemAction), target: self, tag: CAnnotationType.strikeOut.rawValue)
+        _ = stypeMenu.addItem(withTitle: NSLocalizedString("Wavy Line", comment: ""), action: #selector(changeAnnotationMode_itemAction), target: self, tag: CAnnotationType.squiggly.rawValue)
         _ = stypeMenu.addItem(withTitle: NSLocalizedString("Freehand", comment: ""), action: #selector(changeAnnotationMode_itemAction), target: self, tag: CAnnotationType.ink.rawValue)
         _ = stypeMenu.addItem(withTitle: NSLocalizedString("Text Note", comment: ""), action: #selector(changeAnnotationMode_itemAction), target: self, tag: CAnnotationType.freeText.rawValue)
         _ = stypeMenu.addItem(withTitle: NSLocalizedString("Anchored Note", comment: ""), action: #selector(changeAnnotationMode_itemAction), target: self, tag: CAnnotationType.anchored.rawValue)
@@ -556,6 +558,7 @@ extension KMMainViewController {
         let height = NSMenuItem(title: NSLocalizedString("Highlight", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 0)
         let underline = NSMenuItem(title: NSLocalizedString("Underline", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 1)
         let strickout = NSMenuItem(title: NSLocalizedString("Strikethrough", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 2)
+        let wavyLine = NSMenuItem(title: NSLocalizedString("Wavy Line", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 2)
         let text = NSMenuItem(title: NSLocalizedString("Text", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 3)
         let note = NSMenuItem(title: NSLocalizedString("Note", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 4)
         let rectangle = NSMenuItem(title: NSLocalizedString("Rectangle", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 5)
@@ -570,6 +573,7 @@ extension KMMainViewController {
             menu.insertItem(height, at: menu.items.count)
             menu.insertItem(underline, at: menu.items.count)
             menu.insertItem(strickout, at: menu.items.count)
+            menu.insertItem(wavyLine, at: menu.items.count)
             menu.insertItem(NSMenuItem.separator(), at: menu.items.count)
         }
         
@@ -1073,6 +1077,8 @@ extension KMMainViewController {
             itemId = KMToolbarUnderlineAnnotationItemIdentifier
         } else if sender.tag == CAnnotationType.strikeOut.rawValue {
             itemId = KMToolbarStrikeOutAnnotationItemIdentifier
+        } else if sender.tag == CAnnotationType.squiggly.rawValue {
+            itemId = KMToolbarSquigglyAnnotationItemIdentifier
         } else if sender.tag == CAnnotationType.ink.rawValue {
             itemId = KMToolbarInkAnnotationItemIdentifier
         } else if sender.tag == CAnnotationType.freeText.rawValue {
@@ -1103,7 +1109,11 @@ extension KMMainViewController {
         case 1:
             annotationType = .underline
         case 2:
-            annotationType = .strikeOut
+            if sender.title == NSLocalizedString("Wavy Line", comment: "") {
+                annotationType = .squiggly
+            } else {
+                annotationType = .strikeOut
+            }
         case 3:
             annotationType = .freeText
         case 4:

+ 4 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -462,6 +462,10 @@ extension KMMainViewController {
         self.mainMenuUpdateAnnotationStyle(identifier: KMToolbarStrikeOutAnnotationItemIdentifier)
     }
     
+    @IBAction func menuItemAction_wavyLine(_ sender: Any) {
+        self.mainMenuUpdateAnnotationStyle(identifier: KMToolbarSquigglyAnnotationItemIdentifier)
+    }
+    
     @IBAction func menuItemAction_freehand(_ sender: Any) {
         self.mainMenuUpdateAnnotationStyle(identifier: KMToolbarInkAnnotationItemIdentifier)
     }

+ 1 - 0
PDF Office/PDF Master/Class/SystemMenu/KMSystemAnnotationMenu.swift

@@ -11,6 +11,7 @@ protocol KMSystemAnnotationMenuProtocol: NSObjectProtocol {
     func menuItemAction_highlight(_ sender: Any)
     func menuItemAction_underline(_ sender: Any)
     func menuItemAction_deleteLine(_ sender: Any)
+    func menuItemAction_wavyLine(_ sender: Any)
     func menuItemAction_freehand(_ sender: Any)
     func menuItemAction_text(_ sender: Any)
     func menuItemAction_note(_ sender: Any)