Browse Source

综合-菜单栏,补充隐藏页面指示器

tangchao 1 year ago
parent
commit
e7d390db9f

BIN
PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate


+ 36 - 52
PDF Office/PDF Office.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -192,7 +192,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "141"
             endingLineNumber = "141"
-            landmarkName = "importFromWebPage(_:)"
+            landmarkName = "importFromScanner(_:)"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -244,22 +244,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "1EBC6F5E-81E6-486E-AC59-C0EB20B565D6"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Office/Class/ChromiumTabs/KMBrowserWindowController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "126"
-            endingLineNumber = "126"
-            landmarkName = "selectTabContents(path:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -270,42 +254,10 @@
             filePath = "PDF Office/Class/Document/KMDocumentController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "129"
-            endingLineNumber = "129"
-            landmarkName = "newDocumentFromImage(_:)"
+            startingLineNumber = "125"
+            endingLineNumber = "125"
+            landmarkName = "importFromWebPage(_:)"
             landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "8E808B32-51E6-42B7-9413-34DCFE147A14 - 39c002445b87c230"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "closure #1 (Swift.String) -&gt; () in PDF_Office.KMDocumentController.importFromWebPage(Any) -&gt; ()"
-                  moduleName = "PDF Office"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Office/Class/Document/KMDocumentController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "129"
-                  endingLineNumber = "129"
-                  offsetFromSymbolStart = "723">
-               </Location>
-               <Location
-                  uuid = "8E808B32-51E6-42B7-9413-34DCFE147A14 - 8e6db5487b794ec3"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "closure #1 (Swift.Optional&lt;__C.NSDocument&gt;, Swift.Bool, Swift.Optional&lt;Swift.Error&gt;) -&gt; () in closure #1 (Swift.String) -&gt; () in PDF_Office.KMDocumentController.importFromWebPage(Any) -&gt; ()"
-                  moduleName = "PDF Office"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/work/tangchao/git/PDFOffice/PDF%20Office/PDF%20Office/Class/Document/KMDocumentController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "130"
-                  endingLineNumber = "130"
-                  offsetFromSymbolStart = "99">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -404,5 +356,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "594D776A-2CEA-48B9-9AA9-1F025F82BC2F"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Office/Class/Document/KMDocumentController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "80"
+            endingLineNumber = "80"
+            landmarkName = "importFromFile(_:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "DD2AD567-812C-4446-82C3-BF0E9FE45B7A"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Office/Class/Home/ViewController/KMHomeViewController+Action.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1072"
+            endingLineNumber = "1072"
+            landmarkName = "importFromWebPage(_:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 23 - 0
PDF Office/PDF Office/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -235,3 +235,26 @@ extension KMBrowserWindowController: NSSearchFieldDelegate {
         return result
     }
 }
+
+// MARK: -
+// MARK: Menu Actions
+
+// MARK: -
+// MARK: File Menu
+
+extension KMBrowserWindowController {
+    @IBAction func importFromFile(_ sender: Any) {
+        let document: KMMainDocument = self.browser.activeTabContents() as! KMMainDocument
+        document.homeViewController.openSupportPDFButtonAction()
+    }
+    
+    @IBAction func openBlankPage(_ sender: Any) {
+        let document: KMMainDocument = self.browser.activeTabContents() as! KMMainDocument
+        document.homeViewController.openBlankPage(sender)
+    }
+    
+    @IBAction func importFromScanner(_ sender: Any) {
+        let document: KMMainDocument = self.browser.activeTabContents() as! KMMainDocument
+        document.homeViewController.importFromScanner(sender)
+    }
+}

+ 6 - 1
PDF Office/PDF Office/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -176,7 +176,12 @@ extension KMHomeViewController {
         let openPanel = NSOpenPanel()
         openPanel.allowedFileTypes = ["pdf", "PDF", "jpg", "cur", "bmp", "jpeg", "gif", "png", "tiff", "tif", "ico", "icns", "tga", "psd", "eps", "hdr", "jp2", "jpc", "pict", "sgi", "heic", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "pptx"]
         openPanel.allowsMultipleSelection = true
-        openPanel.beginSheetModal(for: self.view.window!) { [self] result in
+        
+        var window = self.view.window
+        if (window == nil) {
+            window = NSApp.mainWindow
+        }
+        openPanel.beginSheetModal(for: window!) { [self] result in
             if result == .OK {
                 var imageUrl: [URL] = []
                 for url in openPanel.urls {

+ 1 - 1
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -277,7 +277,7 @@ extension KMMainViewController {
     }
     
     @IBAction func menuItemAction_hiddenPageIndicator(_ sender: Any) {
-
+        self.hiddenPageIndicator()
     }
 }
 

+ 10 - 3
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -96,9 +96,16 @@ extension KMMainViewController {
         if (KMPreferenceManager.shared.pageIndicatorType == .always) {
             return
         }
-        self.tipCurrentPageBox.fillColor = NSColor.clear
-        self.currentPageLabel.textColor = NSColor.clear
-        self.pageCountLabel.textColor = NSColor.clear
+        
+        self.hiddenPageIndicator()
+    }
+    
+    func hiddenPageIndicator() {
+        DispatchQueue.main.async {
+            self.tipCurrentPageBox.fillColor = NSColor.clear
+            self.currentPageLabel.textColor = NSColor.clear
+            self.pageCountLabel.textColor = NSColor.clear
+        }
     }
 }