Browse Source

【视图】页面控制器编辑优化

lizhe 1 year ago
parent
commit
eff3bf68c7

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -2397,6 +2397,7 @@ extension KMMainViewController {
         super.mouseDown(with: event)
         print("KMMainViewController mouseDown")
         self.leftSideViewCancelSelect()
+        self.pageNumberDisplayView.isEdit = false
     }
 }
 

+ 4 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/Views/KMPageNumberDisplayView/KMPageNumberDisplayView.swift

@@ -55,6 +55,10 @@ class KMPageNumberDisplayView: KMBaseXibView {
     var isEdit: Bool = false {
         didSet {
             self.currentPageIndexLabel.isEditable = isEdit
+            if isEdit {
+                self.currentPageIndexLabel.becomeFirstResponder()
+                self.currentPageIndexLabel.currentEditor()?.selectAll(nil)
+            }
             self.updateUI()
         }
     }