|
@@ -217,6 +217,10 @@ class KMEditPDFPopToolBarController: NSViewController {
|
|
|
@objc func textAlignmentItemClick(_ sender: NSButton) {
|
|
|
self._trackEvent(key: .textAlignment)
|
|
|
|
|
|
+ let itemView = (self.toolbarView?.itemViews.safe_element(for: sender.tag) as? KMEditPDFToolbarItemView)
|
|
|
+ let viewC = (itemView?.obj as? KMDesignButton)
|
|
|
+ viewC?.state = .Act
|
|
|
+
|
|
|
let vc = KMTextAlignmentController(nibName: "KMTextAlignmentController", bundle: nil)
|
|
|
let createFilePopover: NSPopover = NSPopover.init()
|
|
|
createFilePopover.contentViewController = vc
|
|
@@ -229,6 +233,8 @@ class KMEditPDFPopToolBarController: NSViewController {
|
|
|
self.popover_ = createFilePopover
|
|
|
|
|
|
vc.itemAction = { [weak self] idx, _ in
|
|
|
+ viewC?.state = .Norm
|
|
|
+
|
|
|
var data: NSTextAlignment = .left
|
|
|
if idx == 0 {
|
|
|
data = .left
|
|
@@ -242,7 +248,14 @@ class KMEditPDFPopToolBarController: NSViewController {
|
|
|
|
|
|
let model = self?.datas.safe_element(for: sender.tag) as? KMEditPDFToolbarModel
|
|
|
model?.textAlign = data
|
|
|
- self?.toolbarView?.reloadData()
|
|
|
+// self?.toolbarView?.reloadData()
|
|
|
+ if data == .left {
|
|
|
+ viewC?.image = NSImage(named: "KMImageNameEditPDFAlignLeftSelect")!
|
|
|
+ } else if data == .center {
|
|
|
+ viewC?.image = NSImage(named: "KMImageNameEditPDFAlignCenterSelect")!
|
|
|
+ } else if data == .right {
|
|
|
+ viewC?.image = NSImage(named: "KMImageNameEditPDFAlignRightSelect")!
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|