Parcourir la source

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

niehaoyu il y a 10 mois
Parent
commit
bf90c2b22c

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

@@ -811,6 +811,8 @@ extension KMMainViewController {
         if let data = setup.object(forKey: KMMainModel.Key.kDisplayBox) as? NSNumber {
             self.listView.displayBox = CPDFDisplayBox(rawValue: data.intValue) ?? .cropBox
         }
+        
+        self.savePageNumberIfNeed()
     }
     
     func exitPresentationMode() {

+ 8 - 3
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -442,9 +442,14 @@ import Cocoa
         if readModel == true {
             self.openReadModel()
         }
-//        [self applyPDFSettings:hasWindowSetup ? savedNormalSetup : [sud dictionaryForKey:SKDefaultPDFDisplaySettingsKey]];
-//        self.applyPDFSettings((KMDataManager.ud_dictionary(forKey: SKDefaultPDFDisplaySettingsKey) as? NSDictionary) ?? [:])
-//        self.interfaceThemeDidChanged(self.view.window?.appearance?.name ?? (NSApp.appearance?.name ?? .aqua))
+
+        let hasWindowSetup = savedNormalSetup.count > 0
+        if UserDefaults.standard.dictionary(forKey: KMDefaultPDFDisplaySettingsKey) != nil {
+            let pdfSettings: NSDictionary = hasWindowSetup ? savedNormalSetup : UserDefaults.standard.dictionary(forKey: KMDefaultPDFDisplaySettingsKey)! as NSDictionary
+            self.applyPDFSettings(pdfSettings)
+        } else {
+            self.applyPDFSettings(savedNormalSetup)
+        }
     }
     
     //MARK: - PDFListView