|
@@ -331,6 +331,8 @@ struct KMNMWCFlags {
|
|
|
Task {
|
|
|
self.addAutoSaveEvent()
|
|
|
}
|
|
|
+
|
|
|
+ updateUndoRedoState()
|
|
|
}
|
|
|
|
|
|
@objc func editFontColorItemPanelAction(_ sender: Any) {
|
|
@@ -1137,7 +1139,7 @@ struct KMNMWCFlags {
|
|
|
self.componentMessageView.properties.propertyInfo.viewWidth,
|
|
|
self.componentMessageView.properties.propertyInfo.viewHeight)
|
|
|
self.componentMessageView.reloadData()
|
|
|
- self.componentMessageView.show(inView: self.view, autoHideSeconde: 2)
|
|
|
+ self.componentMessageView.showSelf(inView: self.view, autoHideSeconde: 2)
|
|
|
|
|
|
setUpPDFPageNumberToolbar()
|
|
|
|
|
@@ -1180,7 +1182,7 @@ struct KMNMWCFlags {
|
|
|
self.componentMessageView.properties.propertyInfo.viewWidth,
|
|
|
self.componentMessageView.properties.propertyInfo.viewHeight)
|
|
|
self.componentMessageView.reloadData()
|
|
|
- self.componentMessageView.show(inView: self.infoSplitCenterView, autoHideSeconde: 2)
|
|
|
+ self.componentMessageView.showSelf(inView: self.infoSplitCenterView, autoHideSeconde: 2)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3274,6 +3276,17 @@ struct KMNMWCFlags {
|
|
|
self.showPrintWindow()
|
|
|
}
|
|
|
|
|
|
+ //MARK: - Undo,Redo
|
|
|
+ func updateUndoRedoState() {
|
|
|
+ let undo: Bool = self.listView.undoManager?.canUndo ?? false
|
|
|
+ let redo: Bool = self.listView.undoManager?.canRedo ?? false
|
|
|
+
|
|
|
+ toolbarManager.undoProperty.isDisabled = undo ? false : true
|
|
|
+ toolbarManager.redoProperty.isDisabled = redo ? false : true
|
|
|
+
|
|
|
+ pdfToolbarController?.reloadUndoRedoButtonState()
|
|
|
+ }
|
|
|
+
|
|
|
//MARK: - Flattened
|
|
|
func saveAsFlattenedPDFAction() {
|
|
|
DispatchQueue.main.async {
|
|
@@ -4471,7 +4484,7 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
|
|
|
updatePDFDisplaySettingView()
|
|
|
|
|
|
} else if toolbarManager.getSubToolItemIdentifys(KMPDFToolbar_Right_Identifiers).contains(itemIdentifier) {
|
|
|
- if(itemIdentifier == KMPDFToolbar_undo_Identifier) {
|
|
|
+ if (itemIdentifier == KMPDFToolbar_undo_Identifier) {
|
|
|
//MARK: -Undo
|
|
|
if(listView.isEditing()) {
|
|
|
if(listView.canEditTextUndo()){
|
|
@@ -4480,6 +4493,13 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
|
|
|
} else {
|
|
|
listView.undoManager?.undo()
|
|
|
|
|
|
+ self.componentMessageView.properties = ComponentMessageProperty(messageType: .normal_custom, title: KMLocalizedString("Undo"))
|
|
|
+ self.componentMessageView.frame = CGRectMake((CGRectGetWidth(self.view.frame) - self.componentMessageView.properties.propertyInfo.viewWidth)/2,
|
|
|
+ CGRectGetHeight(listView.frame) - self.componentMessageView.properties.propertyInfo.viewHeight - 8,
|
|
|
+ self.componentMessageView.properties.propertyInfo.viewWidth,
|
|
|
+ self.componentMessageView.properties.propertyInfo.viewHeight)
|
|
|
+ self.componentMessageView.reloadData()
|
|
|
+ self.componentMessageView.showSelf(inView: self.view, autoHideSeconde: 2)
|
|
|
}
|
|
|
} else if(itemIdentifier == KMPDFToolbar_redo_Identifier) {
|
|
|
//MARK: -Redo
|
|
@@ -4489,7 +4509,14 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
|
|
|
}
|
|
|
} else {
|
|
|
listView.undoManager?.redo()
|
|
|
-
|
|
|
+
|
|
|
+ self.componentMessageView.properties = ComponentMessageProperty(messageType: .normal_custom, title: KMLocalizedString("Redo"))
|
|
|
+ self.componentMessageView.frame = CGRectMake((CGRectGetWidth(self.view.frame) - self.componentMessageView.properties.propertyInfo.viewWidth)/2,
|
|
|
+ CGRectGetHeight(listView.frame) - self.componentMessageView.properties.propertyInfo.viewHeight - 8,
|
|
|
+ self.componentMessageView.properties.propertyInfo.viewWidth,
|
|
|
+ self.componentMessageView.properties.propertyInfo.viewHeight)
|
|
|
+ self.componentMessageView.reloadData()
|
|
|
+ self.componentMessageView.showSelf(inView: self.view, autoHideSeconde: 2)
|
|
|
}
|
|
|
} else if(itemIdentifier == KMPDFToolbar_fileInfo_Identifier) {
|
|
|
self.showFileInfo()
|