Explorar o código

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

niehaoyu hai 1 ano
pai
achega
6233d0fc5d

+ 5 - 1
PDF Office/PDF Master/Class/Common/Category/NSObject+KMExtension.swift

@@ -795,7 +795,11 @@ extension NSTableView {
         let ris = IndexSet(integersIn: 0 ..< self.numberOfRows)
         let cis = IndexSet(integersIn: 0 ..< self.numberOfColumns)
         let block = {
-            self.reloadData(forRowIndexes: ris, columnIndexes: cis)
+            if cis.isEmpty || ris.isEmpty {
+                self.reloadData()
+            } else {
+                self.reloadData(forRowIndexes: ris, columnIndexes: cis)
+            }
         }
         
         if Thread.isMainThread {

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMBotaTableView.swift

@@ -113,7 +113,7 @@ class KMBotaTableView: NSTableView {
             return
         }
         
-        let userInfo = event.userData as? [String : Any]
+        let userInfo = event.trackingArea?.userInfo as? [String : Any]
         let row = userInfo?["row"] as? Int
         if row != nil {
             KMImageToolTipWindow.shared.fadeOut()

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Thumbnail.swift

@@ -204,7 +204,6 @@ extension KMLeftSideViewController: KMThumbnailTableViewDelegate {
                 var fristIndex = self.thumbnailTableView.selectedRowIndexes.first ?? Int.min
                 var lastIndex = self.thumbnailTableView.selectedRowIndexes.last ?? Int.max
                 for idx in self.thumbnailTableView.selectedRowIndexes {
-//                [leftSideController.thumbnailTableView.selectedRowIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) {
                     if(idx < fristIndex) {
                         fristIndex = idx
                     }
@@ -223,6 +222,7 @@ extension KMLeftSideViewController: KMThumbnailTableViewDelegate {
                     rowIndexSet.insert(i)
                 }
                 self.thumbnailTableView.selectRowIndexes(rowIndexSet, byExtendingSelection: true)
+                self.thumbnailTableView.ks_reloadData()
                 return true
             }
         }

+ 1 - 16
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -227,7 +227,6 @@ class KMLeftSideViewController: KMSideViewController {
         return vc
     }()
     
-    var preThumbnailRow: Int = 0
     var leftMargin: CGFloat = 0
     
     lazy var leftView: KMBotaLeftView = {
@@ -1315,23 +1314,9 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
             let curPage = self.listView.document.index(for: self.listView.currentPage())
             
             if (row != -1 && row != curPage) {
-//                [pdfView goToPage:[[pdfView document] pageAtIndex:row]];
                 self.listView.go(toPageIndex: row, animated: true)
             }
-//                thumbnailSelectCount = row;
-//            var rowIndexSet = IndexSet()
-//            for i in 0 ..< self.thumbnailTableView.numberOfRows {
-//                rowIndexSet.insert(i)
-//            }
-//            self.thumbnailTableView.reloadData(forRowIndexes: rowIndexSet, columnIndexes: IndexSet(integer: 0))
-//            }
-            let view = self.thumbnailTableView.km_safe_view(atColumn: 0, row: self.preThumbnailRow, makeIfNecessary: false) as? KMThumbnailTableviewCell
-            view?.isSelectCell = false
-            
-            let view2 = self.thumbnailTableView.view(atColumn: 0, row: row, makeIfNecessary: false) as? KMThumbnailTableviewCell
-            view2?.isSelectCell = true
-            
-            self.preThumbnailRow = row
+            self.thumbnailTableView.ks_reloadData()
         } else if self.snapshotTableView.isEqual(to: notification.object) {
             let row = self.snapshotTableView.selectedRow
             // 更新选中数据

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationPropertiesViewController.m

@@ -94,7 +94,6 @@
 }
 
 - (void)changeEffectiveAppearance {
-    NSLog(@"changeEffectiveAppearance");
     BOOL isDarkModel = [KMAdvertisementConfig isDarkModel];
     if (isDarkModel) {
         self.view.appearance = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];

+ 40 - 10
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -22,6 +22,7 @@ enum CPDFActiveAreasAlignType : Int {
 class KMEditPDFTextPropertyViewController: NSViewController {
 
     @IBOutlet weak var contentView: NSClipView!
+    @IBOutlet weak var backgroundView: NSView!
     @IBOutlet weak var headerBox: NSBox!
     @IBOutlet weak var imageContentView: NSView!
     @IBOutlet weak var imageViewHeightConstraint: NSLayoutConstraint!
@@ -110,26 +111,59 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         NSColorPanel.shared.setTarget(nil)
         NSColorPanel.shared.setAction(nil)
         NSColorPanel.shared.close()
+        
+        self.removeNotification()
+    }
+    
+    func addNotification() {
+        NotificationCenter.default.addObserver(self, selector: #selector(changeEffectiveAppearance), name: NSNotification.Name(rawValue: "kEffectiveAppearance"), object: nil)
+    }
+    
+    func removeNotification() {
+        NotificationCenter.default.removeObserver(self)
+        DistributedNotificationCenter.default().removeObserver(self)
+    }
+    
+    @objc func changeEffectiveAppearance() {
+        print("changeEffectiveAppearance")
+        let isDarkModel = KMAdvertisementConfig.isDarkModel()
+        if isDarkModel {
+            self.view.appearance = NSAppearance(named: .darkAqua)
+        } else {
+            self.view.appearance = NSAppearance(named: .aqua)
+        }
+        self.updateUI()
+    }
+    
+    func updateUI() {
+        let isDarkModel = KMAdvertisementConfig.isDarkModel()
+        if isDarkModel {
+            self.backgroundView.backgroundColor(NSColor.km_init(hex: "#252526"))
+            self.propertyTitle.textColor = NSColor.init(hex: "#FAFAFA")
+            self.fontTitleLabel.textColor = NSColor.init(hex: "#FAFAFA")
+        } else {
+            self.backgroundView.backgroundColor(NSColor.km_init(hex: "#FAFAFA"))
+            self.propertyTitle.textColor = NSColor.init(hex: "#252629")
+            self.fontTitleLabel.textColor = NSColor.init(hex: "#616469")
+        }
     }
     
     override func viewDidLoad() {
         super.viewDidLoad()
+        self.addNotification()
         self.setup()
         self.initData()
 //        self.reloadData()
         self.updateLanguage()
         self.updatePreviewImage()
+        self.updateUI()
     }
     
     func setup() {
-        self.contentView.backgroundColor(NSColor.km_init(hex: "#F7F8FA"))
-        
         self.propertyTitle.font = NSFont.SFProTextSemiboldFont(14.0)
-        self.propertyTitle.textColor = NSColor.km_init(hex: "#252629")
-        
+
         self.fontTitleLabel.font = NSFont.SFProTextSemiboldFont(12.0)
-        self.fontTitleLabel.textColor = NSColor.km_init(hex: "#616469")
-        
+
         self.headerBox.borderWidth = 1
         self.headerBox.borderColor = NSColor.km_init(hex: "#DFE1E5")
         self.headerBox.cornerRadius = 4
@@ -231,10 +265,6 @@ class KMEditPDFTextPropertyViewController: NSViewController {
         self.fonts = CPDFAnnotationModel.supportFonts() as! [NSDictionary]
     }
     
-    func updateUI() {
-        
-    }
-    
     func updateLanguage() {
         let areas = self.selectAreas
         if textsAreas.count > 0 && textsAreas.count != areas.count { //多选图片跟文字

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

@@ -15,10 +15,9 @@ extension KMMainViewController {
         }
         if searchString == "" {
             self.searchResults = []
-            //            self.leftSideViewController.searchViewController.searchResults = self.searchResults
             self.leftSideViewController.searchResults = self.searchResults
-            //            self.leftSideViewController.searchViewController.reloadData()
             self.listView.setHighlightedSelections([])
+            self.listView.setHighlightedSelection(nil, animated: false)
             self.listView.setNeedsDisplayAnnotationViewForVisiblePages()
         } else {
             mwcFlags.wholeWordSearch = isCase == true ? 1 : 0
@@ -54,10 +53,7 @@ extension KMMainViewController {
             }
             
             self.listView.setHighlightedSelections(_selections)
-//            self.listView.setNeedsDisplayForVisiblePages()
             self.listView.setNeedsDisplayAnnotationViewForVisiblePages()
-            //            self.leftSideViewController.searchViewController.searchResults = self.searchResults
-            //            self.leftSideViewController.searchViewController.reloadData()
             self.leftSideViewController.searchResults = self.searchResults
         }
         

+ 6 - 145
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -206,36 +206,6 @@
                   endingLineNumber = "239"
                   offsetFromSymbolStart = "307">
                </Location>
-               <Location
-                  uuid = "C7C5E7EB-B0DF-4235-AF65-1600A9C47C37 - a1dd9d1b8830716a"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMHomeHistoryFileTableviewCell.historyFileDeleteAction(Swift.Array&lt;Foundation.URL&gt;) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Home/ViewController/KMHomeHistoryFileViewController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "238"
-                  endingLineNumber = "238"
-                  offsetFromSymbolStart = "824">
-               </Location>
-               <Location
-                  uuid = "C7C5E7EB-B0DF-4235-AF65-1600A9C47C37 - 78b20d06475dc1cc"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "closure #1 @Swift.MainActor () -&gt; () in PDF_Reader_Pro.KMHomeHistoryFileTableviewCell.historyFileDeleteAction(Swift.Array&lt;Foundation.URL&gt;) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Home/ViewController/KMHomeHistoryFileViewController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "238"
-                  endingLineNumber = "238"
-                  offsetFromSymbolStart = "360">
-               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -253,38 +223,6 @@
             endingLineNumber = "368"
             landmarkName = "viewDidAppear()"
             landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "04E07B7E-6311-4531-B13B-1CF089F93B9A - 32d5577e3055e387"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMHomeHistoryFileViewController.viewDidAppear() -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Home/ViewController/KMHomeHistoryFileViewController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "368"
-                  endingLineNumber = "368"
-                  offsetFromSymbolStart = "464">
-               </Location>
-               <Location
-                  uuid = "04E07B7E-6311-4531-B13B-1CF089F93B9A - 32d5577e3055e387"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMHomeHistoryFileViewController.viewDidAppear() -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Home/ViewController/KMHomeHistoryFileViewController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "368"
-                  endingLineNumber = "368"
-                  offsetFromSymbolStart = "692">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -301,38 +239,6 @@
             endingLineNumber = "580"
             landmarkName = "deleteAction(_:)"
             landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "97F1A1F6-EA0A-4519-A518-F16347EBF2C5 - 44778aff718b7d0"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMHomeHistoryFileViewController.deleteAction(__C.NSButton) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Home/ViewController/KMHomeHistoryFileViewController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "580"
-                  endingLineNumber = "580"
-                  offsetFromSymbolStart = "396">
-               </Location>
-               <Location
-                  uuid = "97F1A1F6-EA0A-4519-A518-F16347EBF2C5 - 44778aff718b7d0"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMHomeHistoryFileViewController.deleteAction(__C.NSButton) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Home/ViewController/KMHomeHistoryFileViewController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "580"
-                  endingLineNumber = "580"
-                  offsetFromSymbolStart = "632">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -393,8 +299,8 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "3910"
-            endingLineNumber = "3910"
+            startingLineNumber = "3906"
+            endingLineNumber = "3906"
             landmarkName = "clickChildTool(type:index:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -409,8 +315,8 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "3918"
-            endingLineNumber = "3918"
+            startingLineNumber = "3914"
+            endingLineNumber = "3914"
             landmarkName = "clickChildTool(type:index:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -524,21 +430,6 @@
                   endingLineNumber = "92"
                   offsetFromSymbolStart = "653">
                </Location>
-               <Location
-                  uuid = "420D08E5-EF45-4277-8829-126645D63C25 - 655c4cef36e8ca1"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMProfileInfoWindowController.menuItemClicked_Edit(Swift.Optional&lt;Swift.AnyObject&gt;) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFTools/SelfSign/Window/KMProfileInfoWindowController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "92"
-                  endingLineNumber = "92"
-                  offsetFromSymbolStart = "280">
-               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -587,21 +478,6 @@
                   endingLineNumber = "107"
                   offsetFromSymbolStart = "523">
                </Location>
-               <Location
-                  uuid = "9D5FA5F4-0720-42EF-B7B2-1D04CEE324CD - 661d6e6c27ab6d21"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "PDF_Reader_Pro.KMProfileInfoWindowController.menuItemClicked_Add(Swift.Optional&lt;Swift.AnyObject&gt;) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/PDFTools/SelfSign/Window/KMProfileInfoWindowController.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "107"
-                  endingLineNumber = "107"
-                  offsetFromSymbolStart = "144">
-               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -711,8 +587,8 @@
             filePath = "PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2752"
-            endingLineNumber = "2752"
+            startingLineNumber = "2748"
+            endingLineNumber = "2748"
             landmarkName = "showAllConvertWindow(convertT:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -810,21 +686,6 @@
                   endingLineNumber = "53"
                   offsetFromSymbolStart = "181">
                </Location>
-               <Location
-                  uuid = "44337E05-94FF-4B8A-8AB7-5A77E6B1BE81 - 85181671ee2934a3"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "__C.NSUserDefaults.setColor(_: __C.NSColor, forKey: Swift.String) -&gt; ()"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Common/Category/NSUserDefaults_KMExtension.swift"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "53"
-                  endingLineNumber = "53"
-                  offsetFromSymbolStart = "88">
-               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>