|
@@ -211,7 +211,7 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
|
|
|
private var deletePages_ = Set<CPDFPage>()
|
|
|
|
|
|
- var snapshotController = KMSnapshotViewController()
|
|
|
+ var snapshotController: KMSnapshotViewController!
|
|
|
|
|
|
|
|
|
deinit {
|
|
@@ -269,9 +269,6 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
self.initSubView()
|
|
|
self.initDefalutValue()
|
|
|
|
|
|
- self.snapshotController = KMSnapshotViewController(nibName: "KMSnapshotViewController", bundle: Bundle.main)
|
|
|
- self.snapshotController.view.isHidden = true
|
|
|
-// self.view.addSubview(self.snapshotController.view)
|
|
|
|
|
|
self.searchViewController.loadView()
|
|
|
self.searchViewController.contentView = self.findTableView.enclosingScrollView
|
|
@@ -344,6 +341,7 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
|
|
|
if self.snapshotController == nil {
|
|
|
self.snapshotController = KMSnapshotViewController.init()
|
|
|
+ self.snapshotController.view.isHidden = true
|
|
|
}
|
|
|
|
|
|
self.refreshMethodType(methodType: .snapshot)
|
|
@@ -398,10 +396,10 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
self.leftView.autoresizingMask = [.height]
|
|
|
|
|
|
self.thumb_initSubViews()
|
|
|
- self.outline_initSubViews()
|
|
|
- self.note_initSubViews()
|
|
|
+// self.outline_initSubViews()
|
|
|
+// self.note_initSubViews()
|
|
|
// self.snapshot_initSubViews()
|
|
|
- self.search_initSubViews()
|
|
|
+// self.search_initSubViews()
|
|
|
}
|
|
|
|
|
|
func initDefalutValue() {
|
|
@@ -420,10 +418,10 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
|
|
|
|
|
|
self.thumb_initDefalutValue()
|
|
|
- self.outline_initDefalutValue()
|
|
|
- self.note_initDefalutValue()
|
|
|
- self.snapshot_initDefalutValue()
|
|
|
- self.search_initDefalutValue()
|
|
|
+// self.outline_initDefalutValue()
|
|
|
+// self.note_initDefalutValue()
|
|
|
+// self.snapshot_initDefalutValue()
|
|
|
+// self.search_initDefalutValue()
|
|
|
}
|
|
|
|
|
|
func displayThumbnailViewAnimating(_ animate: Bool) {
|
|
@@ -560,11 +558,11 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
self.reloadAnnotation()
|
|
|
}
|
|
|
|
|
|
+ //MARK: Snapshot
|
|
|
func displaySnapshotViewAnimating(_ animate: Bool) {
|
|
|
self.searchViewController.contentView = nil
|
|
|
- if let data = self.snapshotTableView.enclosingScrollView {
|
|
|
- self.replaceSideView(data, animate: animate)
|
|
|
- }
|
|
|
+ self.replaceSideView(self.searchViewController.view, animate: animate)
|
|
|
+
|
|
|
if (self.findState != .snapshot) {
|
|
|
self.findState = .snapshot
|
|
|
} else {
|
|
@@ -960,46 +958,46 @@ extension KMLeftSideViewController {
|
|
|
}
|
|
|
|
|
|
private func _updateViewColor() {
|
|
|
- if(KMAppearance.isDarkMode()){
|
|
|
- self.leftListView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
- self.thumbnailView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
- self.noteView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
- self.outlineView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
- self.view.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
- self.thumbnailTableView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
- self.groupedFindTableView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
- self.tocOutlineView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
- self.findTableView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
-
|
|
|
- self.snapshotController.snapshotSearchField.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
- self.outlineSearchField.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
- self.noteSearchField.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
- self.segmentedControl.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
-
|
|
|
- self.snapshotController.snapshotSearchField.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
|
|
|
- self.outlineSearchField.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
|
|
|
- self.noteSearchField.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
|
|
|
- } else {
|
|
|
- self.leftListView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
- self.thumbnailView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
- self.noteView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
- self.outlineView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
- self.view.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
-
|
|
|
- self.thumbnailTableView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
- self.groupedFindTableView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
- self.tocOutlineView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
- self.findTableView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
-
|
|
|
- self.snapshotController.snapshotSearchField.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
- self.outlineSearchField.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
- self.noteSearchField.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
- self.segmentedControl.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
-
|
|
|
- self.snapshotController.snapshotSearchField.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1)
|
|
|
- self.outlineSearchField.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1)
|
|
|
- self.noteSearchField.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1)
|
|
|
- }
|
|
|
+// if(KMAppearance.isDarkMode()){
|
|
|
+// self.leftListView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
+// self.thumbnailView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
+// self.noteView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
+// self.outlineView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
+// self.view.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
|
|
|
+// self.thumbnailTableView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
+// self.groupedFindTableView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
+// self.tocOutlineView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
+// self.findTableView.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1)
|
|
|
+//
|
|
|
+// self.snapshotController.snapshotSearchField.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
+// self.outlineSearchField.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
+// self.noteSearchField.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
+// self.segmentedControl.layer?.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1).cgColor
|
|
|
+//
|
|
|
+// self.snapshotController.snapshotSearchField.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
|
|
|
+// self.outlineSearchField.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
|
|
|
+// self.noteSearchField.backgroundColor = NSColor(red: 0.224, green: 0.235, blue: 0.243, alpha: 1)
|
|
|
+// } else {
|
|
|
+// self.leftListView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
+// self.thumbnailView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
+// self.noteView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
+// self.outlineView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
+// self.view.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
|
|
|
+//
|
|
|
+// self.thumbnailTableView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
+// self.groupedFindTableView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
+// self.tocOutlineView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
+// self.findTableView.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1.000, alpha: 1)
|
|
|
+//
|
|
|
+// self.snapshotController.snapshotSearchField.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
+// self.outlineSearchField.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
+// self.noteSearchField.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
+// self.segmentedControl.layer?.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
|
|
|
+//
|
|
|
+// self.snapshotController.snapshotSearchField.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1)
|
|
|
+// self.outlineSearchField.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1)
|
|
|
+// self.noteSearchField.backgroundColor = NSColor(red: 0.922, green: 0.925, blue: 0.941, alpha: 1)
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
func hasContainString(_ searchString: String, rootOutline outline: CPDFOutline) -> Bool {
|