Prechádzať zdrojové kódy

【页面编辑】插入菜单自菜单顺序调整

tangchao 1 rok pred
rodič
commit
f021b2749c

+ 6 - 6
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -640,9 +640,9 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
                 item_ = menu.addItem(withTitle: NSLocalizedString("Insert", comment: ""), action: nil, target: self)
                 
                 let subMenu = NSMenu()
-                subMenu.addItem(withTitle: NSLocalizedString("Insert File", comment: ""), action: #selector(insertPageItemAction), target: self, tag:0)
-                subMenu.addItem(withTitle: NSLocalizedString("Insert a Blank Page", comment: ""), action: #selector(insertPageItemAction), target: self, tag:1)
-                subMenu.addItem(withTitle: NSLocalizedString("Insert Custom Page", comment: ""), action: #selector(insertPageItemAction), target: self, tag:2)
+                subMenu.addItem(withTitle: NSLocalizedString("Insert a Blank Page", comment: ""), action: #selector(insertPageItemAction), target: self, tag:0)
+                subMenu.addItem(withTitle: NSLocalizedString("Insert Custom Page", comment: ""), action: #selector(insertPageItemAction), target: self, tag:1)
+                subMenu.addItem(withTitle: NSLocalizedString("Insert File", comment: ""), action: #selector(insertPageItemAction), target: self, tag:2)
                 item_?.submenu = subMenu
             }
         } else if (item.sel == KMPDFThumbViewMenu.splitSelector) {
@@ -665,11 +665,11 @@ extension KMPDFEditViewController {
     
     @objc func insertPageItemAction(menu:NSMenuItem) {
         if (menu.tag == 0) {
-            self.insertFileAction()
-        } else if (menu.tag == 1) {
             self.insertBlankPageAction()
-        } else if (menu.tag == 2) {
+        } else if (menu.tag == 1) {
             self.item_insertCustomPage(sender: nil)
+        } else if (menu.tag == 2) {
+            self.insertFileAction()
         }
     }
     

+ 6 - 6
PDF Office/PDF Master/Class/PDFTools/PageEdit/View/KMPDFEditToolbar.swift

@@ -77,9 +77,9 @@ class KMPDFEditToolbar: NSView {
     var pageRangeValueDidChange: KMValueDidChangeBlock?
     
     lazy var insertItemStrings: [String] = {
-       return [NSLocalizedString("Insert File", comment: ""),
-               NSLocalizedString("Insert a Blank Page", comment: ""),
-               NSLocalizedString("Insert Custom Page", comment: "")]
+       return [NSLocalizedString("Insert a Blank Page", comment: ""),
+               NSLocalizedString("Insert Custom Page", comment: ""),
+               NSLocalizedString("Insert File", comment: "")]
     }()
     
     private weak var popover: NSPopover?
@@ -184,11 +184,11 @@ class KMPDFEditToolbar: NSView {
                 return
             }
             if (index == 0) {
-                self?.item_insertFile(sender: nil)
-            } else if (index == 1) {
                 self?.item_insertBlankPage(sender: nil)
-            } else if (index == 2) {
+            } else if (index == 1) {
                 self?.item_insertCustomPage(sender: nil)
+            } else if (index == 2) {
+                self?.item_insertFile(sender: nil)
             }
         }
     }