Pārlūkot izejas kodu

【fix】【BOTA】注释列表点击注释回复icon,建议自动进入输入状态(参考Windows)

tangchao 5 mēneši atpakaļ
vecāks
revīzija
f2793c427f

+ 4 - 0
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -77,6 +77,10 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     private var fileAttri_: KMFileAttribute?
     private var popOver_: NSPopover?
     
+    deinit {
+        
+    }
+    
     required init?(coder: NSCoder) {
         super.init(coder: coder)
     }

+ 8 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -2143,10 +2143,18 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
                 cell?.updateUI(expand: data.isExpand, animated: data.animated)
                 data.animated = false
                 
+                if data.isFirstResp {
+                    DispatchQueue.main.async {
+                        self.view.window?.makeFirstResponder(cell?.inputTextF)
+                    }
+                    data.isFirstResp = false
+                }
+                
                 cell?.itemClick = { [weak self] idx, param in
                     if idx == 1 { // comment
                         data.isExpand = !data.isExpand
                         data.animated = true
+                        data.isFirstResp = true
                         data.annoModel?.isExpand = data.isExpand
 //                        self?.noteOutlineView.reloadItem(data)
                         self?.noteOutlineView.reloadData()

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Model/KMAnnotationModel.swift

@@ -54,6 +54,8 @@ class KMBotaAnnotationFooterModel: KMBotaAnnotationBaseModel {
     weak var annoModel: KMBotaAnnotationModel?
     
     weak var replyModel: KMBotaAnnotationReplyModel?
+    
+    var isFirstResp = false
 }
 
 class KMBotaAnnotationReplyModel: KMBotaAnnotationBaseModel {