|
@@ -171,6 +171,14 @@ import Cocoa
|
|
}
|
|
}
|
|
}
|
|
}
|
|
datas.append(model)
|
|
datas.append(model)
|
|
|
|
+
|
|
|
|
+ if key == .fontAdd || key == .fontReduce {
|
|
|
|
+ if let item = self._fetchCurrentItem(itemKey: key) {
|
|
|
|
+ if item.isEnabled != model.isEnabled {
|
|
|
|
+ needUpdateData = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if needUpdateData {
|
|
if needUpdateData {
|
|
@@ -293,6 +301,18 @@ import Cocoa
|
|
|
|
|
|
// MARK: - Private Methods
|
|
// MARK: - Private Methods
|
|
|
|
|
|
|
|
+ private func _fetchCurrentItem(itemKey: KMEditPDFToolbarItemKey) -> KMEditPDFToolbarModel? {
|
|
|
|
+ guard let contentC = self.contentViewController as? KMEditPDFPopToolBarController else {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ for model in contentC.datas {
|
|
|
|
+ if model.itemKey == itemKey {
|
|
|
|
+ return model
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+
|
|
private func _fontSizeItemIsEnabled() -> Bool {
|
|
private func _fontSizeItemIsEnabled() -> Bool {
|
|
if self.model.editAreasFontSizeIsEqual() {
|
|
if self.model.editAreasFontSizeIsEqual() {
|
|
if let fontSize = self.model.fontSizes.first, fontSize == -1 {
|
|
if let fontSize = self.model.fontSizes.first, fontSize == -1 {
|