Переглянути джерело

Merge branch 'develop_PDFReaderProV4.6.1' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProV4.6.1

tangchao 5 місяців тому
батько
коміт
57e9bfcde7

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/MainWindowController/KMPresentationTopViewController.swift

@@ -190,7 +190,7 @@ public class KMPresentationTopViewController: NSViewController, KMDrawViewDelega
     }
     
     public func drawView(_ drawView: KMDrawView!, didDrawEnd point: CGPoint) {
-        
+        undoButton.isEnabled = ((pdfView?.presentationDrawView.canUndo()) == true)
     }
 
 }

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

@@ -5534,7 +5534,10 @@ extension KMMainViewController: KMReadModelViewDelegate {
     // MARK: - KMPresentationTopViewController (幻灯片)
     func presentationTopViewExit(_ presentationTopViewController: KMPresentationTopViewController, withButton: NSButton) {
         if  self.canExitPresentation() == true {
-            self.browserWindowController?.exitFullscreen()
+            let mainDocument = self.myDocument as? KMMainDocument
+            let browserWindowController = mainDocument?.browser?.windowController as? KMBrowserWindowController
+            browserWindowController?.exitFullscreen()
+            
         }
     }
     

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

@@ -1316,7 +1316,7 @@ extension KMMainViewController {
     }
     
     @IBAction func menuItemAction_mergeAllWindow(_ sender: Any) {
-        ((self.myDocument as? KMMainDocument)?.browser.windowController as? KMBrowserWindowController)?.mergeAllWindow(sender)
+        ((self.myDocument as? KMMainDocument)?.browser?.windowController as? KMBrowserWindowController)?.mergeAllWindow(sender)
     }
     
     @IBAction func menuItemAction_currentWindowName(_ sender: Any) {

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

@@ -122,7 +122,7 @@ import Cocoa
     var mwcFlags: MwcFlags = MwcFlags()
     var document: CPDFDocument?
     var myDocument: NSDocument?
-    weak var browserWindowController: KMBrowserWindowController?
+    weak var browserWindowController: KMBrowserWindowController? //慎直接使用这个方法
     
     var cropSettingWindowController: KMCropSettingWindowController!
     var currentWindowController: NSWindowController!
@@ -1969,7 +1969,9 @@ import Cocoa
             if event.keyCode == 53 {
                 if let data = self?.interactionMode, data == .presentation { // 幻灯片模式下
                     if let data = self?.canExitPresentation(), data {
-                        self?.browserWindowController?.exitFullscreen()
+                        let mainDocument = self?.myDocument as? KMMainDocument
+                        let browserWindowController = mainDocument?.browser?.windowController as? KMBrowserWindowController
+                        browserWindowController?.exitFullscreen()
                     }
                     return nil
                 }