Переглянути джерело

【注释回复】回复功能补充

tangchao 1 місяць тому
батько
коміт
a5c70df562

+ 8 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteFooterCellView.swift

@@ -29,6 +29,8 @@ class KMNoteFooterCellView: NSTableCellView, NibLoadable {
     
     var itemClick: KMCommonClickBlock?
     
+    var model: KMBotaAnnotationFooterModel?
+    
     private var flag_ = false
     
     override func draw(_ dirtyRect: NSRect) {
@@ -43,6 +45,8 @@ class KMNoteFooterCellView: NSTableCellView, NibLoadable {
         
         self.flag_ = false
         
+//        self.replyBox.fillColor = .red
+        self.inputBox.cornerRadius = 0
         self.inputBox.borderColor = NSColor(white: 0, alpha: 0.2)
         self.inputBox.fillColor = .white
         self.inputBox.moveCallback = { [weak self] enter, theBox in
@@ -56,6 +60,10 @@ class KMNoteFooterCellView: NSTableCellView, NibLoadable {
                 }
             }
         }
+        self.inputBox.downCallback = { [weak self] enter, theBox, _ in
+            theBox.window?.makeFirstResponder(self?.inputTextF)
+            
+        }
         self.inputTextF.drawsBackground = false
         self.inputTextF.isBordered = false
         self.inputTextF.isBezeled = false

+ 5 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteFooterCellView.xib

@@ -31,20 +31,20 @@
             <rect key="frame" x="0.0" y="0.0" width="453" height="108"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
-                <box borderType="line" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Zps-kZ-RvQ">
+                <box borderType="line" title="Box" titlePosition="noTitle" transparent="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zps-kZ-RvQ">
                     <rect key="frame" x="-3" y="40" width="459" height="70"/>
                     <view key="contentView" id="fr9-7p-tnW">
                         <rect key="frame" x="3" y="3" width="453" height="64"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="nRc-Dh-PEL" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                <rect key="frame" x="32" y="32" width="409" height="32"/>
+                                <rect key="frame" x="16" y="32" width="425" height="32"/>
                                 <view key="contentView" id="fIS-wd-lpj">
-                                    <rect key="frame" x="1" y="1" width="407" height="30"/>
+                                    <rect key="frame" x="1" y="1" width="423" height="30"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
                                         <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HuQ-4F-E6t" customClass="KMTextField" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                            <rect key="frame" x="4" y="7" width="399" height="16"/>
+                                            <rect key="frame" x="4" y="7" width="415" height="16"/>
                                             <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" id="6De-hm-do0">
                                                 <font key="font" usesAppearanceFont="YES"/>
                                                 <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -82,7 +82,7 @@
                             <constraint firstItem="cqz-a4-FAh" firstAttribute="top" secondItem="nRc-Dh-PEL" secondAttribute="bottom" constant="12" id="CkL-Wf-SbD"/>
                             <constraint firstItem="d2W-fA-bBI" firstAttribute="leading" secondItem="cqz-a4-FAh" secondAttribute="trailing" constant="12" id="EQb-gf-Dsq"/>
                             <constraint firstItem="nRc-Dh-PEL" firstAttribute="top" secondItem="fr9-7p-tnW" secondAttribute="top" id="JUc-qE-48C"/>
-                            <constraint firstItem="nRc-Dh-PEL" firstAttribute="leading" secondItem="fr9-7p-tnW" secondAttribute="leading" constant="32" id="Sn4-P3-Sde"/>
+                            <constraint firstItem="nRc-Dh-PEL" firstAttribute="leading" secondItem="fr9-7p-tnW" secondAttribute="leading" constant="16" id="Sn4-P3-Sde"/>
                             <constraint firstItem="d2W-fA-bBI" firstAttribute="top" secondItem="nRc-Dh-PEL" secondAttribute="bottom" constant="12" id="WS7-OZ-Krf"/>
                             <constraint firstAttribute="trailing" secondItem="d2W-fA-bBI" secondAttribute="trailing" constant="12" id="snO-R5-W1k"/>
                         </constraints>

+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteReplyCellView.swift

@@ -17,8 +17,12 @@ class KMNoteReplyCellView: NSTableCellView, NibLoadable {
     @IBOutlet weak var moreBox: NSBox!
     @IBOutlet weak var moreButton: KMCoverButton!
     
+    @IBOutlet weak var leftVorLineView: NSView!
+    
     var itemClick: KMCommonClickBlock?
     
+    var model: KMBotaAnnotationReplyModel?
+    
     override func draw(_ dirtyRect: NSRect) {
         super.draw(dirtyRect)
 
@@ -27,6 +31,7 @@ class KMNoteReplyCellView: NSTableCellView, NibLoadable {
     
     override func awakeFromNib() {
         super.awakeFromNib()
+        self.backgroundBox.borderWidth = 0
         
         self.timeLabel.lineBreakMode = .byTruncatingTail
         self.titleLabel.textColor = .black
@@ -43,9 +48,16 @@ class KMNoteReplyCellView: NSTableCellView, NibLoadable {
                 btn.image = NSImage(named: "KMImageNameBotaNoteReplyMore")
             }
         }
+        
+        self.leftVorLineView.wantsLayer = true
+        self.leftVorLineView.layer?.backgroundColor = NSColor(white: 0, alpha: 0.2).cgColor
     }
     
     @objc func moreAction(_ sender: NSButton) {
         self.itemClick?(1, sender)
     }
+    
+    override func mouseUp(with event: NSEvent) {
+        super.mouseUp(with: event)
+    }
 }

+ 25 - 15
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteReplyCellView.xib

@@ -9,18 +9,18 @@
         <customObject id="-2" userLabel="File's Owner"/>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <tableCellView id="cJ2-C3-BYm" customClass="KMNoteReplyCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="248" height="74"/>
+        <tableCellView misplaced="YES" id="cJ2-C3-BYm" customClass="KMNoteReplyCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="248" height="70"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Gun-Jd-J23">
-                    <rect key="frame" x="16" y="0.0" width="216" height="74"/>
+                    <rect key="frame" x="16" y="0.0" width="220" height="66"/>
                     <view key="contentView" id="v5i-Rx-mrG">
-                        <rect key="frame" x="1" y="1" width="214" height="72"/>
+                        <rect key="frame" x="1" y="1" width="218" height="64"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YhK-ga-zgX">
-                                <rect key="frame" x="6" y="48" width="37" height="16"/>
+                                <rect key="frame" x="6" y="40" width="37" height="16"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="e3s-gk-8Zg">
                                     <font key="font" usesAppearanceFont="YES"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -28,13 +28,13 @@
                                 </textFieldCell>
                             </textField>
                             <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="jIA-71-L4Q">
-                                <rect key="frame" x="174" y="36" width="36" height="36"/>
+                                <rect key="frame" x="190" y="40" width="24" height="24"/>
                                 <view key="contentView" id="ZKd-Tw-1e4">
-                                    <rect key="frame" x="1" y="1" width="34" height="34"/>
+                                    <rect key="frame" x="1" y="1" width="22" height="22"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
                                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XZ6-t2-NDE" customClass="KMCoverButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                            <rect key="frame" x="0.0" y="0.0" width="34" height="34"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="22" height="22"/>
                                             <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="hxw-Rm-tjD">
                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                 <font key="font" metaFont="system"/>
@@ -49,12 +49,12 @@
                                     </constraints>
                                 </view>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="36" id="V2t-4Y-H2A"/>
-                                    <constraint firstAttribute="width" constant="36" id="rJp-GF-LsF"/>
+                                    <constraint firstAttribute="height" constant="24" id="V2t-4Y-H2A"/>
+                                    <constraint firstAttribute="width" constant="24" id="rJp-GF-LsF"/>
                                 </constraints>
                             </box>
                             <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="IC2-1d-jhL">
-                                <rect key="frame" x="6" y="16" width="92" height="16"/>
+                                <rect key="frame" x="6" y="12" width="92" height="16"/>
                                 <textFieldCell key="cell" selectable="YES" title="Multiline Label" id="HAk-oO-E2d">
                                     <font key="font" metaFont="system"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -62,32 +62,41 @@
                                 </textFieldCell>
                             </textField>
                             <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="vul-74-pMF">
-                                <rect key="frame" x="43" y="48" width="92" height="16"/>
+                                <rect key="frame" x="43" y="40" width="92" height="16"/>
                                 <textFieldCell key="cell" selectable="YES" title="Multiline Label" id="FwT-2V-3L3">
                                     <font key="font" metaFont="system"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                 </textFieldCell>
                             </textField>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="zvz-ss-Nrt">
+                                <rect key="frame" x="0.0" y="0.0" width="1" height="64"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="1" id="TgQ-cH-Tvw"/>
+                                </constraints>
+                            </customView>
                         </subviews>
                         <constraints>
                             <constraint firstItem="jIA-71-L4Q" firstAttribute="top" secondItem="v5i-Rx-mrG" secondAttribute="top" id="6IS-E0-ChE"/>
-                            <constraint firstItem="IC2-1d-jhL" firstAttribute="top" secondItem="YhK-ga-zgX" secondAttribute="bottom" constant="16" id="6NK-mB-h4x"/>
+                            <constraint firstItem="IC2-1d-jhL" firstAttribute="top" secondItem="YhK-ga-zgX" secondAttribute="bottom" constant="12" id="6NK-mB-h4x"/>
                             <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="IC2-1d-jhL" secondAttribute="trailing" constant="8" id="Apx-e8-jqR"/>
                             <constraint firstItem="YhK-ga-zgX" firstAttribute="top" secondItem="v5i-Rx-mrG" secondAttribute="top" constant="8" id="RAe-xa-8Pl"/>
                             <constraint firstItem="YhK-ga-zgX" firstAttribute="leading" secondItem="v5i-Rx-mrG" secondAttribute="leading" constant="8" id="Uz3-mS-fnY"/>
+                            <constraint firstAttribute="bottom" secondItem="zvz-ss-Nrt" secondAttribute="bottom" id="WKz-5M-FD0"/>
                             <constraint firstItem="jIA-71-L4Q" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vul-74-pMF" secondAttribute="trailing" constant="2" id="bTE-26-Ydq"/>
                             <constraint firstItem="vul-74-pMF" firstAttribute="top" secondItem="v5i-Rx-mrG" secondAttribute="top" constant="8" id="iJ3-TI-B68"/>
                             <constraint firstItem="vul-74-pMF" firstAttribute="leading" secondItem="YhK-ga-zgX" secondAttribute="trailing" constant="4" id="lhD-Pt-AI7"/>
                             <constraint firstAttribute="trailing" secondItem="jIA-71-L4Q" secondAttribute="trailing" constant="4" id="rPz-Bc-tuR"/>
-                            <constraint firstAttribute="bottom" secondItem="IC2-1d-jhL" secondAttribute="bottom" constant="16" id="rX1-E6-ibA"/>
+                            <constraint firstAttribute="bottom" secondItem="IC2-1d-jhL" secondAttribute="bottom" constant="12" id="rX1-E6-ibA"/>
+                            <constraint firstItem="zvz-ss-Nrt" firstAttribute="top" secondItem="v5i-Rx-mrG" secondAttribute="top" id="rnN-BD-Xu5"/>
                             <constraint firstItem="IC2-1d-jhL" firstAttribute="leading" secondItem="v5i-Rx-mrG" secondAttribute="leading" constant="8" id="tKc-r7-kcT"/>
+                            <constraint firstItem="zvz-ss-Nrt" firstAttribute="leading" secondItem="v5i-Rx-mrG" secondAttribute="leading" id="uJm-PX-Uut"/>
                         </constraints>
                     </view>
                 </box>
             </subviews>
             <constraints>
-                <constraint firstAttribute="trailing" secondItem="Gun-Jd-J23" secondAttribute="trailing" constant="16" id="2gT-zp-lTN"/>
+                <constraint firstAttribute="trailing" secondItem="Gun-Jd-J23" secondAttribute="trailing" constant="12" id="2gT-zp-lTN"/>
                 <constraint firstItem="Gun-Jd-J23" firstAttribute="top" secondItem="cJ2-C3-BYm" secondAttribute="top" id="hhq-XB-HPC"/>
                 <constraint firstAttribute="bottom" secondItem="Gun-Jd-J23" secondAttribute="bottom" id="tNb-Ko-CwT"/>
                 <constraint firstItem="Gun-Jd-J23" firstAttribute="leading" secondItem="cJ2-C3-BYm" secondAttribute="leading" constant="16" id="vv8-HJ-b8h"/>
@@ -95,6 +104,7 @@
             <connections>
                 <outlet property="backgroundBox" destination="Gun-Jd-J23" id="CCn-fK-BaQ"/>
                 <outlet property="contentLabel" destination="IC2-1d-jhL" id="BgV-ji-YIn"/>
+                <outlet property="leftVorLineView" destination="zvz-ss-Nrt" id="bFt-oN-bMj"/>
                 <outlet property="moreBox" destination="jIA-71-L4Q" id="pCM-YA-xsh"/>
                 <outlet property="moreButton" destination="XZ6-t2-NDE" id="Kmp-hj-pDj"/>
                 <outlet property="timeLabel" destination="vul-74-pMF" id="KGx-eD-rC1"/>

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

@@ -2075,6 +2075,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
                 if cell == nil {
                     cell = KMNoteFooterCellView.createFromNib()
                 }
+                cell?.model = data
                 
                 let cnt = self.noteReplyHanddler.fetchReplyAnnotations(data.anno)?.count ?? 0
                 if cnt == 0 {
@@ -2122,6 +2123,11 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
                             model.annoModel = data.annoModel
                             data.annoModel?.replyAnnos.append(model)
                             self?.noteOutlineView.reloadData()
+//                            self?.noteOutlineView.ks_reloadData()
+//                            DispatchQueue.main.async {
+                                //                            }
+//                                self?.noteOutlineView.reloadItem(data)
+//                            }
                         }
                     } else if idx == 4 { // cancel
                         
@@ -2135,6 +2141,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
                 if cell == nil {
                     cell = KMNoteReplyCellView.createFromNib()
                 }
+                cell?.model = data
                 cell?.titleLabel.stringValue = data.replyAnno?.userName() ?? ""
                 if let data = data.replyAnno?.modificationDate() {
                     cell?.timeLabel.stringValue = KMTools.timeString(timeDate: data)
@@ -2257,11 +2264,98 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
             return itemView
         } else if outlineView.isEqual(self.noteOutlineView) {
             let itemView = KMBotaTableRowView()
+            if let data = item as? KMBotaAnnotationBaseModel {
+                itemView.isSelected = data.isSelected
+                
+                
+            }
+            itemView.selectCallback = { theView in
+                let isSelected = theView.isSelected
+                
+                if theView.numberOfColumns > 0 {
+                    let cellView = theView.view(atColumn: 0)
+                    if let data = cellView as? KMSectionCellView {
+                        return
+                    }
+                    var model: KMBotaAnnotationModel?
+                    var indexs = IndexSet()
+                    if let data = cellView as? KMNoteFooterCellView {
+                        model = data.model?.annoModel
+                        model?.isSelected = isSelected
+                        
+                        self.view.window?.makeFirstResponder(data.inputTextF) 
+                    }
+                    if let data = cellView as? KMNoteReplyCellView {
+                        model = data.model?.annoModel
+                        
+                        model?.isSelected = isSelected
+                    }
+                    if let data = cellView as? KMNoteTableViewCell {
+                        model = data.model
+                        model?.isSelected = isSelected
+                    }
+//
+                    if let data = model {
+//                        let row = self.noteOutlineView.row(for: cellView as! NSView)
+                        let row = self.noteOutlineView.row(forItem: data)
+                        indexs.insert(row)
+                        var i = 1
+                        for item in model?.replyAnnos ?? [] {
+                            indexs.insert(row+i)
+                            i += 1
+                        }
+                        indexs.insert(row+i)
+//                        self.noteOutlineView.km_safe_selectRowIndexes(indexs, byExtendingSelection: false)
+//                        self.noteOutlineView.selectRowIndexes(indexs, byExtendingSelection: false)
+//                        self.noteOutlineView.km_selectRow(indexs.first!)
+//                        self.noteOutlineView.selectedItem()
+                        
+                    }
+                    KMPrint("")
+                }
+               
+            }
             return itemView;
         }
         return nil
     }
     
+    func outlineView(_ outlineView: NSOutlineView, selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet) -> IndexSet {
+        if outlineView.isEqual(to: self.noteOutlineView) {
+            var indexs = proposedSelectionIndexes
+            for i in proposedSelectionIndexes {
+                let item = self.noteOutlineView.item(atRow: i)
+                var model: KMBotaAnnotationModel?
+                if let data = item as? KMBotaAnnotationSectionModel {
+                    
+                }
+                if let data = item as? KMBotaAnnotationModel {
+                    model = data
+                }
+                if let data = item as? KMBotaAnnotationReplyModel {
+                    model = data.annoModel
+                }
+                if let data = item as? KMBotaAnnotationFooterModel {
+                    model = data.annoModel
+                }
+                
+                if let data = model {
+//                        let row = self.noteOutlineView.row(for: cellView as! NSView)
+                    let row = self.noteOutlineView.row(forItem: data)
+                    indexs.insert(row)
+                    var i = 1
+                    for item in model?.replyAnnos ?? [] {
+                        indexs.insert(row+i)
+                        i += 1
+                    }
+                    indexs.insert(row+i)
+                }
+            }
+            return indexs
+        }
+        return proposedSelectionIndexes
+    }
+    
     func outlineViewSelectionDidChange(_ notification: Notification) {
         if self.tocOutlineView.isEqual(to: notification.object) {
             if self.dragIn {

+ 2 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/LeftSideView.xib

@@ -1124,7 +1124,7 @@
             </scroller>
             <point key="canvasLocation" x="35" y="749.5"/>
         </scrollView>
-        <scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="94" horizontalPageScroll="10" verticalLineScroll="94" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="X6S-DN-K9m">
+        <scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="92" horizontalPageScroll="10" verticalLineScroll="92" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="X6S-DN-K9m">
             <rect key="frame" x="0.0" y="0.0" width="251" height="429"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="z3N-jy-sfp">
@@ -1134,7 +1134,6 @@
                     <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" tableStyle="plain" typeSelect="NO" autosaveName="KMNoteOutlineView" rowHeight="92" usesAutomaticRowHeights="YES" viewBased="YES" indentationPerLevel="16" outlineTableColumn="yso-Z1-ZNZ" id="ZeT-gb-jMM" customClass="KMNoteOutlineView" customModule="PDF_Reader_Pro" customModuleProvider="target">
                         <rect key="frame" x="0.0" y="0.0" width="251" height="429"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <size key="intercellSpacing" width="0.0" height="2"/>
                         <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                         <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
                         <tableColumns>
@@ -1151,7 +1150,7 @@
                                 <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                 <prototypeCellViews>
                                     <tableCellView identifier="KMNoteTableViewCell" id="3TS-lp-G7v" customClass="KMNoteTableViewCell" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="1" width="251" height="117"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="251" height="117"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="udQ-rE-Njy">

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

@@ -14,6 +14,7 @@ class KMAnnotationModel: NSObject {
 class KMBotaAnnotationBaseModel: KMAnnotationModel {
     var isExpand = false
     var animated = false
+    var isSelected = false
 }
 
 class KMBotaAnnotationModel: KMBotaAnnotationBaseModel {

+ 13 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/View/KMBotaTableRowView.swift

@@ -8,6 +8,8 @@
 import Cocoa
 
 class KMBotaTableRowView: NSTableRowView {
+    var selectCallback: ((KMBotaTableRowView)->Void)?
+    
     convenience init() {
         self.init(frame: .zero)
         
@@ -31,4 +33,15 @@ class KMBotaTableRowView: NSTableRowView {
         let selectionPath = NSBezierPath(roundedRect: selectionRect, xRadius: 0, yRadius: 0)
         selectionRect.fill()
     }
+    
+    override var isSelected: Bool {
+        get {
+            return super.isSelected
+        }
+        set {
+            super.isSelected = newValue
+            
+            self.selectCallback?(self)
+        }
+    }
 }