|
@@ -58,6 +58,7 @@ import Cocoa
|
|
|
@objc optional func changePDFViewGotoNextPageAction()
|
|
|
@objc optional func changePDFViewGoToPreviousPageAction()
|
|
|
@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, shareDocument 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)
|
|
|
}
|
|
|
|
|
|
-class KMToolbarViewController: NSViewController {
|
|
|
+class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
|
|
|
|
|
|
var toolbar : KMToolbar!
|
|
|
var toolbarType : KMToolbarViewType = KMToolbarViewType.None
|
|
@@ -83,6 +84,7 @@ class KMToolbarViewController: NSViewController {
|
|
|
var shareButton = KMToolbarClickButton()
|
|
|
override func 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("CPDFListViewToolModeChangeNotification"), object: nil)
|
|
|
}
|
|
@@ -267,6 +269,13 @@ class KMToolbarViewController: NSViewController {
|
|
|
}
|
|
|
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 {
|