Przeglądaj źródła

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

tangchao 10 miesięcy temu
rodzic
commit
2446768606

+ 5 - 0
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -377,6 +377,11 @@ import Cocoa
     }
 
     func closeAllTabs(_ sender: Any) -> Void {
+        if let noti = sender as? NSNotification, noti.object is CTTabController {
+            if let window_ = (noti.object as! CTTabController).view.window, window_.isEqual(to: self.window) == false {
+                return
+            }
+        }
         if self.browser != nil {
             self.browser.closeAllTabs()
         }

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/AppKitCategories/CPDFListEditAnnotationViewController.swift

@@ -67,7 +67,7 @@ class CPDFListEditAnnotationViewController: NSViewController, NSTextViewDelegate
             box?.borderColor = NSColor.white
             self.contentTextView.insertionPointColor = NSColor.black
         }
-        box?.fillColor = KMAppearance.KMColor_Layout_L1()
+        box?.fillColor = KMAppearance.Layout.l1Color()
         self.colors.removeAll()
         var i = 0
         for color in KMAnnotationPropertiesColorManager.manager.anchoredNoteColors {

+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -1581,10 +1581,10 @@ NSNotificationName const KMPDFViewTableAnnotationDidChangeNotification = @"KMPDF
                 annotation.contents = listEditAnnotationViewController.contentString;
                 [self setNeedsDisplayAnnotation:annotation];
             } else {
-                if([self.activeAnnotations containsObject:annotation]) {
-                    [self.activeAnnotations removeObject:annotation];
-                }
-                [self removeAnnotation:annotation];
+//                if([self.activeAnnotations containsObject:annotation]) {
+//                    [self.activeAnnotations removeObject:annotation];
+//                }
+//                [self removeAnnotation:annotation];
             }
         } else {
             annotation.contents = listEditAnnotationViewController.contentString;

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

@@ -731,8 +731,15 @@ extension KMMainViewController {
             readAlertView?.removeFromSuperview()
         }
         readAlertView = CustomAlertView.alertView(message: NSLocalizedString("Read Mode On", comment: ""), fromView: self.view, withStyle: .blue, backgroundColor: NSColor.km_init(hex: "#36383B"))
-        self.updateAITipViewShowState()
+        
+        if self.aiTipView != nil {
+            self.updateAITipViewShowState()
+        }
 //        self.aiTipView.isHidden = true
+        
+        UserDefaults.standard.set(isReadMode, forKey: "kKMPDFViewIsReadMode")
+        UserDefaults.standard.synchronize()
+        
     }
     
     @objc func closeReadModel() {
@@ -787,6 +794,9 @@ extension KMMainViewController {
         }
         readAlertView = CustomAlertView.alertView(message: NSLocalizedString("Read Mode Off", comment: ""), fromView: self.view, withStyle: .blue, backgroundColor: NSColor.km_init(hex: "#36383B"))
         self.updateAITipViewShowState()
+        
+        UserDefaults.standard.set(isReadMode, forKey: "kKMPDFViewIsReadMode")
+        UserDefaults.standard.synchronize()
     }
     
     @objc func addOutLineItemAction() {

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

@@ -429,6 +429,10 @@ import Cocoa
             }
         }
         
+        let readModel = UserDefaults.standard.bool(forKey: "kKMPDFViewIsReadMode")
+        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))