|
@@ -99,7 +99,7 @@ import Cocoa
|
|
|
listView.scaleFactor = 1.0
|
|
|
}
|
|
|
}
|
|
|
- self.initPDFListView()
|
|
|
+ self.initPDFLeftViewVC()
|
|
|
self.initRightSideView()
|
|
|
self.toolbarController.listView = self.listView
|
|
|
}
|
|
@@ -138,13 +138,15 @@ import Cocoa
|
|
|
self.locationPageView.layer?.backgroundColor = NSColor(red: 189.0/255.0, green: 223.0/255.0, blue: 253.0/255.0, alpha: 1).cgColor
|
|
|
self.tipLabel.stringValue = NSLocalizedString("Please use the scroll bar, thumbnail tool to locate the target page, click or box the area to select the target range.", comment: "")
|
|
|
|
|
|
+ self.checkShouldAutoOpenLeftVC()
|
|
|
+
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(rename(_:)), name: NSNotification.Name.init(rawValue: "KMTabControllerRename"), object: nil)
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(showInFinder(_:)), name: NSNotification.Name.init(rawValue: "KMTabControllerShowInFinder"), object: nil)
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(preferenceDidChangeNotification), name: Notification.Name(KMPreferenceDidChangeNotificationName), object: nil)
|
|
|
}
|
|
|
|
|
|
//MARK: - PDFListView
|
|
|
- func initPDFListView() {
|
|
|
+ func initPDFLeftViewVC() {
|
|
|
leftSideViewController.listView = self.listView ?? CPDFListView()
|
|
|
leftSideViewController.view.frame = CGRect(x: 0, y:0 , width: self.leftView.frame.size.width, height: self.leftView.frame.size.height)
|
|
|
leftSideViewController.view.autoresizingMask = [.height,.width]
|
|
@@ -193,6 +195,29 @@ import Cocoa
|
|
|
|
|
|
// MARK: Private Methods
|
|
|
|
|
|
+ func checkShouldAutoOpenLeftVC() {
|
|
|
+ if (KMPreferenceManager.shared.leftSideDisplayType == 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
|
|
|
+ let selectedIndex = UserDefaults.standard.integer(forKey: "KMBOTASelectedIndexKey")
|
|
|
+ let thumai = KMLeftMethodMode()
|
|
|
+ if selectedIndex == 0 {
|
|
|
+ thumai.methodType = .Thumbnail
|
|
|
+ } else if selectedIndex == 1 {
|
|
|
+ thumai.methodType = .Outline
|
|
|
+ } else if selectedIndex == 2 {
|
|
|
+ thumai.methodType = .BookMark
|
|
|
+ } else if selectedIndex == 3 {
|
|
|
+ thumai.methodType = .Annotation
|
|
|
+ } else if selectedIndex == 4 {
|
|
|
+ thumai.methodType = .Search
|
|
|
+ }
|
|
|
+ var show = true
|
|
|
+ self.leftSideViewController.refreshMethodType(newType: thumai, show:show)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
func applyLeftSideWidth(_ leftSideWidth: CGFloat, rightSideWidth: CGFloat) -> Void {
|
|
|
mianSplitView.setPosition(leftSideWidth, ofDividerAt: 0)
|
|
|
mianSplitView.setPosition(mianSplitView.maxPossiblePositionOfDivider(at: 1) - mianSplitView.dividerThickness - rightSideWidth, ofDividerAt: 1)
|