|
@@ -58,6 +58,7 @@ import Cocoa
|
|
@objc optional func changePDFViewGotoNextPageAction()
|
|
@objc optional func changePDFViewGotoNextPageAction()
|
|
@objc optional func changePDFViewGoToPreviousPageAction()
|
|
@objc optional func changePDFViewGoToPreviousPageAction()
|
|
@objc optional func showPDFViewPrintViewController()
|
|
@objc optional func showPDFViewPrintViewController()
|
|
|
|
+ @objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomSting : String)
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomModel selectedTag:Int)
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, zoomModel selectedTag:Int)
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareDocument item:NSMenuItem)
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareDocument item:NSMenuItem)
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareFlatten item:NSMenuItem)
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, shareFlatten item:NSMenuItem)
|
|
@@ -68,7 +69,7 @@ import Cocoa
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, rightPanel toolbarItem: KMToolBoxItem)
|
|
@objc optional func toolbarViewController(_ viewController:KMToolbarViewController, rightPanel toolbarItem: KMToolBoxItem)
|
|
}
|
|
}
|
|
|
|
|
|
-class KMToolbarViewController: NSViewController {
|
|
|
|
|
|
+class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
|
|
|
|
|
|
var toolbar : KMToolbar!
|
|
var toolbar : KMToolbar!
|
|
var toolbarType : KMToolbarViewType = KMToolbarViewType.None
|
|
var toolbarType : KMToolbarViewType = KMToolbarViewType.None
|
|
@@ -83,6 +84,7 @@ class KMToolbarViewController: NSViewController {
|
|
var shareButton = KMToolbarClickButton()
|
|
var shareButton = KMToolbarClickButton()
|
|
override func viewDidLoad() {
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
super.viewDidLoad()
|
|
|
|
+ self.zoomTextField.delegate = self
|
|
NotificationCenter.default.addObserver(self, selector: #selector(listViewAnnotationTypeChangeNotification), name: Notification.Name("CPDFListViewAnnotationTypeChangeNotification"), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(listViewAnnotationTypeChangeNotification), name: Notification.Name("CPDFListViewAnnotationTypeChangeNotification"), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(listViewAnnotationTypeChangeNotification), name: Notification.Name("CPDFListViewToolModeChangeNotification"), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(listViewAnnotationTypeChangeNotification), name: Notification.Name("CPDFListViewToolModeChangeNotification"), object: nil)
|
|
}
|
|
}
|
|
@@ -267,6 +269,13 @@ class KMToolbarViewController: NSViewController {
|
|
}
|
|
}
|
|
return KMToolBoxItem()
|
|
return KMToolBoxItem()
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ func controlTextDidEndEditing(_ obj: Notification) {
|
|
|
|
+ let textField = obj.object as? NSTextField
|
|
|
|
+ if textField == self.zoomTextField {
|
|
|
|
+ self.delegate?.toolbarViewController?(self, zoomSting: self.zoomTextField.stringValue)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
extension KMToolbarViewController : KMNewToolbarDelegate,NSToolbarItemValidation {
|
|
extension KMToolbarViewController : KMNewToolbarDelegate,NSToolbarItemValidation {
|