|
@@ -88,6 +88,8 @@ class KMThumbnailViewController: NSViewController {
|
|
|
}
|
|
|
|
|
|
func initNotification() {
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(PDFViewEditingAreaDidChangedNotification), name: NSNotification.Name.init(rawValue: "kPDFViewEditingAreaDidChanged"), object: nil)
|
|
|
+
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(KMPDFViewPageCountChangedNotification), name: NSNotification.Name.init(rawValue: "KMPDFViewRotatePage"), object: nil)
|
|
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(KMPDFViewCurrentPageDidChangedNotification), name: NSNotification.Name.init(rawValue: "KMPDFViewCurrentPageDidChanged"), object: nil)
|
|
@@ -231,6 +233,17 @@ class KMThumbnailViewController: NSViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @objc func PDFViewEditingAreaDidChangedNotification(notification: NSNotification) {
|
|
|
+ if notification.object is CPDFDocument {
|
|
|
+ let pdfdocument : CPDFDocument = notification.object as! CPDFDocument
|
|
|
+ if pdfdocument.isEqual(self.listView.document) {
|
|
|
+ var indexs: IndexSet = IndexSet()
|
|
|
+ indexs.insert(IndexSet.Element(self.listView.currentPageIndex))
|
|
|
+ self.reloadDataAtIndexs(indexs: indexs)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
func pdfCurrentPageChange () {
|
|
|
if self.listView.document.pageCount == 0 {
|
|
|
return
|