Browse Source

【注释回复】回复输入框UI补充

tangchao 5 months ago
parent
commit
46d8728873
13 changed files with 583 additions and 11 deletions
  1. 22 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteComment.imageset/Contents.json
  2. BIN
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteComment.imageset/message 1.pdf
  3. BIN
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteComment.imageset/message.pdf
  4. 22 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteOpration.imageset/Contents.json
  5. 95 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteOpration.imageset/sidebar 1.pdf
  6. 95 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteOpration.imageset/sidebar.pdf
  7. 66 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteFooterCellView.swift
  8. 196 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteFooterCellView.xib
  9. 19 5
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift
  10. 24 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift
  11. 14 4
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Model/KMAnnotationModel.swift
  12. 14 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Tools/KMNoteReplyHanddler.swift
  13. 16 0
      PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

+ 22 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteComment.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "message.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "message 1.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteComment.imageset/message 1.pdf


BIN
PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteComment.imageset/message.pdf


+ 22 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteOpration.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "sidebar.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "sidebar 1.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 95 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteOpration.imageset/sidebar 1.pdf

@@ -0,0 +1,95 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 4.000000 3.500000 cm
+0.262745 0.278431 0.301961 scn
+4.000000 11.500000 m
+8.500000 11.500000 l
+10.156855 11.500000 11.500000 10.156855 11.500000 8.500000 c
+11.500000 4.000000 l
+11.500000 2.343145 10.156855 1.000000 8.500000 1.000000 c
+1.000000 1.000000 l
+1.000000 8.500000 l
+1.000000 10.156855 2.343146 11.500000 4.000000 11.500000 c
+h
+0.000000 8.500000 m
+0.000000 10.709139 1.790861 12.500000 4.000000 12.500000 c
+8.500000 12.500000 l
+10.709139 12.500000 12.500000 10.709139 12.500000 8.500000 c
+12.500000 4.000000 l
+12.500000 1.790861 10.709139 0.000000 8.500000 0.000000 c
+1.000000 0.000000 l
+0.000000 0.000000 l
+0.000000 1.000000 l
+0.000000 8.500000 l
+h
+3.879310 6.534483 m
+3.379310 6.534483 l
+3.379310 5.534483 l
+3.879310 5.534483 l
+9.051724 5.534483 l
+9.551724 5.534483 l
+9.551724 6.534483 l
+9.051724 6.534483 l
+3.879310 6.534483 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  913
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000001003 00000 n
+0000001025 00000 n
+0000001198 00000 n
+0000001272 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1331
+%%EOF

+ 95 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/LeftSide/Note/KMImageNameBotaNoteOpration.imageset/sidebar.pdf

@@ -0,0 +1,95 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 4.000000 3.500000 cm
+0.262745 0.278431 0.301961 scn
+4.000000 11.500000 m
+8.500000 11.500000 l
+10.156855 11.500000 11.500000 10.156855 11.500000 8.500000 c
+11.500000 4.000000 l
+11.500000 2.343145 10.156855 1.000000 8.500000 1.000000 c
+1.000000 1.000000 l
+1.000000 8.500000 l
+1.000000 10.156855 2.343146 11.500000 4.000000 11.500000 c
+h
+0.000000 8.500000 m
+0.000000 10.709139 1.790861 12.500000 4.000000 12.500000 c
+8.500000 12.500000 l
+10.709139 12.500000 12.500000 10.709139 12.500000 8.500000 c
+12.500000 4.000000 l
+12.500000 1.790861 10.709139 0.000000 8.500000 0.000000 c
+1.000000 0.000000 l
+0.000000 0.000000 l
+0.000000 1.000000 l
+0.000000 8.500000 l
+h
+3.879310 6.534483 m
+3.379310 6.534483 l
+3.379310 5.534483 l
+3.879310 5.534483 l
+9.051724 5.534483 l
+9.551724 5.534483 l
+9.551724 6.534483 l
+9.051724 6.534483 l
+3.879310 6.534483 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  913
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000001003 00000 n
+0000001025 00000 n
+0000001198 00000 n
+0000001272 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1331
+%%EOF

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

@@ -0,0 +1,66 @@
+//
+//  KMNoteFooterCellView.swift
+//  PDF Reader Pro
+//
+//  Created by User-Tangchao on 2024/9/19.
+//
+
+import Cocoa
+
+class KMNoteFooterCellView: NSTableCellView, NibLoadable {
+    @IBOutlet weak var replyBox: NSBox!
+    @IBOutlet weak var inputBox: NSBox!
+    @IBOutlet weak var replyButton: NSButton!
+    @IBOutlet weak var cancelButton: NSButton!
+    
+    @IBOutlet weak var commentBox: NSBox!
+    @IBOutlet weak var commentIv: NSImageView!
+    @IBOutlet weak var commentNumberLabel: NSTextField!
+    @IBOutlet weak var commentButton: NSButton!
+    
+    @IBOutlet weak var operationBox: NSBox!
+    @IBOutlet weak var operationIv: NSImageView!
+    @IBOutlet weak var operationIv2: NSImageView!
+    @IBOutlet weak var operationButton: NSButton!
+    
+    var itemClick: KMCommonClickBlock?
+    
+    override func draw(_ dirtyRect: NSRect) {
+        
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.replyButton.title = NSLocalizedString("Reply", comment: "")
+        self.replyButton.wantsLayer = true
+        self.replyButton.setTitleColor(color: .white, font: .SFProTextRegularFont(14))
+        self.replyButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
+        self.cancelButton.title = NSLocalizedString("Clear", comment: "")
+        self.cancelButton.setTitleColor(color: KMAppearance.Layout.h2Color(), font: .SFProTextRegularFont(14))
+        
+        self.commentBox.borderWidth = 0
+        self.commentIv.image = NSImage(named: "KMImageNameBotaNoteComment")
+        self.commentButton.title = ""
+        self.commentButton.target = self
+        self.commentButton.action = #selector(commentAction)
+        
+        self.operationBox.borderWidth = 0
+        self.operationIv.image = NSImage(named: "KMImageNameBotaNoteOpration")
+        self.operationIv2.image = NSImage(named: "KMImageNameBotaNoteExpand")
+        self.operationButton.title = ""
+        self.operationButton.target = self
+        self.operationButton.action = #selector(operationAction)
+    }
+    
+    @objc func commentAction(_ sender: NSButton) {
+        self.itemClick?(1)
+    }
+    
+    @objc func operationAction(_ sender: NSButton) {
+        self.itemClick?(2, sender)
+    }
+}

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

@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMNoteFooterCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="cancelButton" destination="cqz-a4-FAh" id="z7S-Nk-wAK"/>
+                <outlet property="commentBox" destination="AKC-lX-l6Q" id="BFy-yZ-XDq"/>
+                <outlet property="commentButton" destination="qqx-Rf-Mhy" id="yT1-6k-26K"/>
+                <outlet property="commentIv" destination="M9A-Ef-540" id="wQx-Fk-oUm"/>
+                <outlet property="commentNumberLabel" destination="qTH-Ub-ikb" id="Gcb-LO-BTR"/>
+                <outlet property="inputBox" destination="nRc-Dh-PEL" id="Opi-DP-7vf"/>
+                <outlet property="operationBox" destination="D8j-Z1-l9J" id="70j-Kc-RgO"/>
+                <outlet property="operationButton" destination="7m2-cH-Gl5" id="KLF-9o-FZU"/>
+                <outlet property="operationIv" destination="nhM-fn-Lml" id="0XX-Wz-2NY"/>
+                <outlet property="operationIv2" destination="33u-Me-AUW" id="xAb-2S-GWS"/>
+                <outlet property="replyBox" destination="Zps-kZ-RvQ" id="sqd-Ip-mVO"/>
+                <outlet property="replyButton" destination="d2W-fA-bBI" id="tcc-kg-HEU"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="KMNoteFooterCellView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="453" height="112"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <box borderType="line" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Zps-kZ-RvQ">
+                    <rect key="frame" x="-3" y="44" 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">
+                                <rect key="frame" x="32" y="32" width="409" height="32"/>
+                                <view key="contentView" id="fIS-wd-lpj">
+                                    <rect key="frame" x="1" y="1" width="407" height="30"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                </view>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="32" id="SYy-3T-Ng5"/>
+                                </constraints>
+                            </box>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="d2W-fA-bBI">
+                                <rect key="frame" x="396" y="4" width="45" height="16"/>
+                                <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="p4p-ds-vYh">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                            </button>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cqz-a4-FAh">
+                                <rect key="frame" x="339" y="4" width="45" height="16"/>
+                                <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="ZIH-CU-juN">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstAttribute="trailing" secondItem="nRc-Dh-PEL" secondAttribute="trailing" constant="12" id="0Ur-tE-yDr"/>
+                            <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="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>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="64" id="Mlc-8C-aLh"/>
+                    </constraints>
+                </box>
+                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="AKC-lX-l6Q">
+                    <rect key="frame" x="381" y="12" width="60" height="20"/>
+                    <view key="contentView" id="D5W-gK-4uq">
+                        <rect key="frame" x="1" y="1" width="58" height="18"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="M9A-Ef-540">
+                                <rect key="frame" x="0.0" y="-2" width="20" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="20" id="3YT-S7-ZrS"/>
+                                    <constraint firstAttribute="height" constant="20" id="scF-8s-hLN"/>
+                                </constraints>
+                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="eJN-tF-XK9"/>
+                            </imageView>
+                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qTH-Ub-ikb">
+                                <rect key="frame" x="23" y="1" width="37" height="16"/>
+                                <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="6hx-gG-YNt">
+                                    <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>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qqx-Rf-Mhy">
+                                <rect key="frame" x="0.0" y="0.0" width="58" height="18"/>
+                                <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="vGY-Fc-PHo">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="qTH-Ub-ikb" firstAttribute="leading" secondItem="M9A-Ef-540" secondAttribute="trailing" constant="5" id="0SM-Qf-oDH"/>
+                            <constraint firstItem="qqx-Rf-Mhy" firstAttribute="leading" secondItem="D5W-gK-4uq" secondAttribute="leading" id="17i-F0-QRF"/>
+                            <constraint firstItem="qqx-Rf-Mhy" firstAttribute="top" secondItem="D5W-gK-4uq" secondAttribute="top" id="Jmk-sT-sUb"/>
+                            <constraint firstAttribute="trailing" secondItem="qTH-Ub-ikb" secondAttribute="trailing" id="PbM-0f-Dq2"/>
+                            <constraint firstAttribute="trailing" secondItem="qqx-Rf-Mhy" secondAttribute="trailing" id="U6T-R3-4lt"/>
+                            <constraint firstAttribute="bottom" secondItem="qqx-Rf-Mhy" secondAttribute="bottom" id="gO2-jw-T0f"/>
+                            <constraint firstItem="M9A-Ef-540" firstAttribute="leading" secondItem="D5W-gK-4uq" secondAttribute="leading" id="hzj-u7-X7f"/>
+                            <constraint firstItem="M9A-Ef-540" firstAttribute="top" secondItem="D5W-gK-4uq" secondAttribute="top" id="lZ9-fB-zgU"/>
+                            <constraint firstItem="qTH-Ub-ikb" firstAttribute="centerY" secondItem="D5W-gK-4uq" secondAttribute="centerY" id="ujc-4g-ZcD"/>
+                        </constraints>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="20" id="deI-Df-S6e"/>
+                    </constraints>
+                </box>
+                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="D8j-Z1-l9J">
+                    <rect key="frame" x="331" y="12" width="34" height="20"/>
+                    <view key="contentView" id="c41-HI-s8f">
+                        <rect key="frame" x="1" y="1" width="32" height="18"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nhM-fn-Lml">
+                                <rect key="frame" x="0.0" y="1" width="16" height="16"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="16" id="fwj-3t-zk0"/>
+                                    <constraint firstAttribute="height" constant="16" id="okA-gC-I4Q"/>
+                                </constraints>
+                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="dLo-wA-93h"/>
+                            </imageView>
+                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="33u-Me-AUW">
+                                <rect key="frame" x="16" y="1" width="16" height="16"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="16" id="1hs-7X-St7"/>
+                                    <constraint firstAttribute="width" constant="16" id="KzI-dz-8UV"/>
+                                </constraints>
+                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="DVD-io-itp"/>
+                            </imageView>
+                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7m2-cH-Gl5">
+                                <rect key="frame" x="0.0" y="0.0" width="32" height="18"/>
+                                <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="eVZ-K1-wkb">
+                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                    <font key="font" metaFont="system"/>
+                                </buttonCell>
+                            </button>
+                        </subviews>
+                        <constraints>
+                            <constraint firstAttribute="trailing" secondItem="33u-Me-AUW" secondAttribute="trailing" id="0Tb-QJ-IKJ"/>
+                            <constraint firstAttribute="trailing" secondItem="7m2-cH-Gl5" secondAttribute="trailing" id="Fk9-mQ-m49"/>
+                            <constraint firstItem="7m2-cH-Gl5" firstAttribute="leading" secondItem="c41-HI-s8f" secondAttribute="leading" id="Kqm-hP-sQD"/>
+                            <constraint firstItem="nhM-fn-Lml" firstAttribute="leading" secondItem="c41-HI-s8f" secondAttribute="leading" id="OBd-5s-BCo"/>
+                            <constraint firstAttribute="bottom" secondItem="7m2-cH-Gl5" secondAttribute="bottom" id="b5U-df-A6h"/>
+                            <constraint firstItem="nhM-fn-Lml" firstAttribute="centerY" secondItem="c41-HI-s8f" secondAttribute="centerY" id="bnd-ru-hgg"/>
+                            <constraint firstItem="33u-Me-AUW" firstAttribute="leading" secondItem="nhM-fn-Lml" secondAttribute="trailing" id="jsj-cO-Uky"/>
+                            <constraint firstItem="33u-Me-AUW" firstAttribute="centerY" secondItem="c41-HI-s8f" secondAttribute="centerY" id="k1c-NZ-r9b"/>
+                            <constraint firstItem="7m2-cH-Gl5" firstAttribute="top" secondItem="c41-HI-s8f" secondAttribute="top" id="ttw-A3-CZu"/>
+                        </constraints>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="20" id="kca-qs-XfC"/>
+                    </constraints>
+                </box>
+            </subviews>
+            <constraints>
+                <constraint firstItem="D8j-Z1-l9J" firstAttribute="centerY" secondItem="AKC-lX-l6Q" secondAttribute="centerY" id="Bay-me-SUu"/>
+                <constraint firstAttribute="bottom" secondItem="AKC-lX-l6Q" secondAttribute="bottom" constant="12" id="Nol-iE-7UE"/>
+                <constraint firstAttribute="trailing" secondItem="Zps-kZ-RvQ" secondAttribute="trailing" id="RVa-g5-2Gl"/>
+                <constraint firstItem="Zps-kZ-RvQ" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="UP8-yd-0EJ"/>
+                <constraint firstItem="AKC-lX-l6Q" firstAttribute="top" secondItem="Zps-kZ-RvQ" secondAttribute="bottom" constant="16" id="fbR-we-VWb"/>
+                <constraint firstAttribute="trailing" secondItem="AKC-lX-l6Q" secondAttribute="trailing" constant="12" id="gFB-6P-VV3"/>
+                <constraint firstItem="AKC-lX-l6Q" firstAttribute="leading" secondItem="D8j-Z1-l9J" secondAttribute="trailing" constant="16" id="gdQ-4H-R9l"/>
+                <constraint firstItem="Zps-kZ-RvQ" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="klZ-3P-NUk"/>
+            </constraints>
+            <connections>
+                <outlet property="cancelButton" destination="d2W-fA-bBI" id="MwT-RV-Rwy"/>
+                <outlet property="commentBox" destination="AKC-lX-l6Q" id="qxG-aV-vYh"/>
+                <outlet property="commentButton" destination="qqx-Rf-Mhy" id="9rW-8N-agP"/>
+                <outlet property="commentIv" destination="M9A-Ef-540" id="EVD-Dc-BoI"/>
+                <outlet property="commentNumberLabel" destination="qTH-Ub-ikb" id="Jig-To-gZK"/>
+                <outlet property="inputBox" destination="nRc-Dh-PEL" id="2fg-aA-Cce"/>
+                <outlet property="operationBox" destination="D8j-Z1-l9J" id="O4w-ur-fTG"/>
+                <outlet property="operationButton" destination="7m2-cH-Gl5" id="tTi-vO-4R6"/>
+                <outlet property="operationIv" destination="nhM-fn-Lml" id="4eY-xa-myG"/>
+                <outlet property="operationIv2" destination="33u-Me-AUW" id="JAg-dD-R7S"/>
+                <outlet property="replyBox" destination="Zps-kZ-RvQ" id="IzR-7Q-Nck"/>
+                <outlet property="replyButton" destination="cqz-a4-FAh" id="bcn-AD-PIb"/>
+            </connections>
+            <point key="canvasLocation" x="-42.5" y="59.5"/>
+        </customView>
+    </objects>
+</document>

+ 19 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift

@@ -407,7 +407,9 @@ extension KMLeftSideViewController {
             let selModels = self.annoListModel?.datas ?? []
             for selModel in selModels {
                 for item in selModel.items {
-                    models.append(item)
+                    if let data = item as? KMBotaAnnotationModel {
+                        models.append(data)
+                    }
                 }
             }
         }
@@ -675,8 +677,10 @@ extension KMLeftSideViewController {
         } else { // 常规模式(非搜索)
             for model in self.annoListModel?.datas ?? [] {
                 for item in model.items {
-                    if anno.isEqual(to: item.anno) {
-                        return item
+                    if let data = item as? KMBotaAnnotationModel {
+                        if anno.isEqual(to: data.anno) {
+                            return data
+                        }
                     }
                 }
             }
@@ -989,6 +993,10 @@ extension KMLeftSideViewController {
                     secM?.items.append(item)
                     
                     prePageIdx = Int(anno.pageIndex())
+                
+                let footerI = KMBotaAnnotationFooterModel()
+                footerI.anno = anno
+                secM?.items.append(footerI)
 //                }
                 
 //                let item = KMBotaAnnotationModel()
@@ -1064,7 +1072,10 @@ extension KMLeftSideViewController {
                     guard let _ = item.anno else {
                         continue
                     }
-                    self.noteSearchArray.append(item)
+                    guard let data = item as? KMBotaAnnotationModel else {
+                        continue
+                    }
+                    self.noteSearchArray.append(data)
                 }
             }
         } else {
@@ -1087,8 +1098,11 @@ extension KMLeftSideViewController {
                     if caseInsensite {
                         noteString = noteString.lowercased()
                     }
+                    guard let data = item as? KMBotaAnnotationModel else {
+                        continue
+                    }
                     if noteString.contains(stringValue) {
-                        self.noteSearchArray.append(item)
+                        self.noteSearchArray.append(data)
                     }
                 }
             }

+ 24 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -1956,7 +1956,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
             
             var idx = 0
             var flagSectionM: KMBotaAnnotationSectionModel?
-            var flagItem: KMBotaAnnotationModel?
+            var flagItem: KMBotaAnnotationBaseModel?
             var isSection = false
             for sectionM in self.annoListModel?.datas ?? [] {
                 idx += 1
@@ -2040,6 +2040,29 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
                 }
                 return cell
             }
+            if let data = item as? KMBotaAnnotationFooterModel {
+                var cell = outlineView.makeView(withIdentifier: KMNoteFooterCellView.km_identifier, owner: self) as? KMNoteFooterCellView
+                if cell == nil {
+                    cell = KMNoteFooterCellView.createFromNib()
+                }
+                
+                let cnt = self.noteReplyHanddler.fetchReplyAnnotations(data.anno)?.count ?? 0
+                if cnt == 0 {
+                    cell?.commentNumberLabel.stringValue = ""
+                } else {
+                    cell?.commentNumberLabel.stringValue = "\(cnt)"
+                }
+                
+                cell?.itemClick = { idx, param in
+                    if idx == 1 { // comment
+                        KMPrint("comment")
+                    } else if idx == 2 { //
+                        KMPrint("22222222222")
+                    }
+                }
+                
+                return cell
+            }
             let model = item as? KMBotaAnnotationModel
             let note = (item as? KMBotaAnnotationModel)?.anno
             let cell = outlineView.makeView(withIdentifier: KMNoteTableViewCell.km_identifier, owner: self) as! KMNoteTableViewCell

+ 14 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Model/KMAnnotationModel.swift

@@ -11,7 +11,11 @@ class KMAnnotationModel: NSObject {
     weak var anno: CPDFAnnotation?
 }
 
-class KMBotaAnnotationModel: KMAnnotationModel {
+class KMBotaAnnotationBaseModel: KMAnnotationModel {
+    var isExpand = false
+}
+
+class KMBotaAnnotationModel: KMBotaAnnotationBaseModel {
     var showPage                = true
     var showTime                = true
     var showAuthor              = true
@@ -40,8 +44,12 @@ class KMBotaAnnotationModel: KMAnnotationModel {
     }
 }
 
+class KMBotaAnnotationFooterModel: KMBotaAnnotationBaseModel {
+    
+}
+
 class KMBotaAnnotationSectionModel: NSObject {
-    var items: [KMBotaAnnotationModel] = []
+    var items: [KMBotaAnnotationBaseModel] = []
     
     var itemCount: Int {
         get {
@@ -98,8 +106,10 @@ class KMAnnotationListModel: NSObject {
         var models: [KMBotaAnnotationModel] = []
         for model in self.datas {
             for itemM in model.items {
-                if itemM.canFold() {
-                    models.append(itemM)
+                if let data = itemM as? KMBotaAnnotationModel {
+                    if data.canFold() {
+                        models.append(data)
+                    }
                 }
             }
         }

+ 14 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Tools/KMNoteReplyHanddler.swift

@@ -10,7 +10,6 @@ import Cocoa
 // 注释回复处理类
 
 class KMNoteReplyHanddler: NSObject {
-    
     func markAnnotation(_ anno: CPDFAnnotation?) {
         guard let replyA = self.fetchMarkAnnotation(anno) else {
             anno?.createReplyStateAnnotation(.marked)
@@ -37,6 +36,20 @@ class KMNoteReplyHanddler: NSObject {
         return replyA.getAnnotState()
     }
     
+    func fetchReplyAnnotations(_ anno: CPDFAnnotation?) -> [CPDFAnnotation]? {
+        guard let theAnno = anno else {
+            return nil
+        }
+        
+        var annos: [CPDFAnnotation] = []
+        for a in theAnno.replyAnnotations ?? [] {
+            if a.replyAnnotationType == .reply {
+                annos.append(a)
+            }
+        }
+        return annos
+    }
+    
     func fetchMarkAnnotation(_ anno: CPDFAnnotation?) -> CPDFAnnotation? {
         guard let theAnno = anno else {
             return nil

+ 16 - 0
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -30,6 +30,12 @@
 		6536FDE32C9C1EF2004A0FB9 /* KMNoteReplyHanddler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6536FDE22C9C1EF2004A0FB9 /* KMNoteReplyHanddler.swift */; };
 		6536FDE42C9C1EF2004A0FB9 /* KMNoteReplyHanddler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6536FDE22C9C1EF2004A0FB9 /* KMNoteReplyHanddler.swift */; };
 		6536FDE52C9C1EF2004A0FB9 /* KMNoteReplyHanddler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6536FDE22C9C1EF2004A0FB9 /* KMNoteReplyHanddler.swift */; };
+		6536FDE72C9C49A6004A0FB9 /* KMNoteFooterCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6536FDE62C9C49A6004A0FB9 /* KMNoteFooterCellView.swift */; };
+		6536FDE82C9C49A6004A0FB9 /* KMNoteFooterCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6536FDE62C9C49A6004A0FB9 /* KMNoteFooterCellView.swift */; };
+		6536FDE92C9C49A6004A0FB9 /* KMNoteFooterCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6536FDE62C9C49A6004A0FB9 /* KMNoteFooterCellView.swift */; };
+		6536FDEB2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6536FDEA2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib */; };
+		6536FDEC2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6536FDEA2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib */; };
+		6536FDED2C9C49C1004A0FB9 /* KMNoteFooterCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6536FDEA2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib */; };
 		654A5A832C895DE5001FBD4B /* KMComparativeGradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD6218D32A7D29F40088475C /* KMComparativeGradientView.swift */; };
 		654A5A842C895DE6001FBD4B /* KMComparativeGradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD6218D32A7D29F40088475C /* KMComparativeGradientView.swift */; };
 		654A5A852C89628A001FBD4B /* KMWatermarkAdjectivePropertyBaseController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB897235294B38DC0045787C /* KMWatermarkAdjectivePropertyBaseController.xib */; };
@@ -5562,6 +5568,8 @@
 		65341C732C63CCFE00FE30F9 /* KMSearchReplaceWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMSearchReplaceWindowController.xib; sourceTree = "<group>"; };
 		65341C7B2C646C6400FE30F9 /* KMSearchReplaceHanddler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMSearchReplaceHanddler.swift; sourceTree = "<group>"; };
 		6536FDE22C9C1EF2004A0FB9 /* KMNoteReplyHanddler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNoteReplyHanddler.swift; sourceTree = "<group>"; };
+		6536FDE62C9C49A6004A0FB9 /* KMNoteFooterCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNoteFooterCellView.swift; sourceTree = "<group>"; };
+		6536FDEA2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMNoteFooterCellView.xib; sourceTree = "<group>"; };
 		654A5A8B2C8AE200001FBD4B /* KMAnalytics+KMExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KMAnalytics+KMExtensions.swift"; sourceTree = "<group>"; };
 		655445082C88483B00BD9010 /* KMDiscountToSaveWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMDiscountToSaveWindowController.xib; sourceTree = "<group>"; };
 		655445092C88483C00BD9010 /* KMDiscountToSaveWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMDiscountToSaveWindowController.h; sourceTree = "<group>"; };
@@ -8267,6 +8275,8 @@
 				BB3A66AA2B078FB200575343 /* KMNoteTableViewCell.swift */,
 				65FABB302C9AFB0C00AA92E5 /* KMSectionCellView.swift */,
 				65FABB342C9AFB1F00AA92E5 /* KMSectionCellView.xib */,
+				6536FDE62C9C49A6004A0FB9 /* KMNoteFooterCellView.swift */,
+				6536FDEA2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib */,
 				BB4F7E882B0C55E70077EC8C /* KMFilterAuthorLabel.swift */,
 				BB4F7E942B0C857D0077EC8C /* KMNoteTypeCollectionViewItem.swift */,
 				BB4F7E982B0C858D0077EC8C /* KMNoteTypeCollectionViewItem.xib */,
@@ -14756,6 +14766,7 @@
 				ADAFDA102AE8DD6600F084BC /* KMAdvertisementCollectionHeadView.xib in Resources */,
 				ADAFDA1C2AE8DD6600F084BC /* KMAdvertisementTableView.xib in Resources */,
 				BB1B0B0D2B4FC6E900889528 /* KMGuideInfoWindowController.xib in Resources */,
+				6536FDEB2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib in Resources */,
 				BB7F7BFA29AA469F00A3E4E7 /* KMSigntureViewItem.xib in Resources */,
 				ADAFDA0D2AE8DD6600F084BC /* KMAdvertisementCollectionViewItem.xib in Resources */,
 				9F1F82E62934D5240092C4B4 /* KMHomeExtractActionViewController.xib in Resources */,
@@ -15317,6 +15328,7 @@
 				ADBC375929CAE95700D93208 /* KMComparativeOutlineSectionCell.xib in Resources */,
 				AD3AAD172B0B5B2700DE5FE7 /* KMCompareContentWindowController.xib in Resources */,
 				ADDF83482B391A5C00A81A4E /* DSignatureCreateInfoViewController.xib in Resources */,
+				6536FDEC2C9C49C0004A0FB9 /* KMNoteFooterCellView.xib in Resources */,
 				BBEC00D5295C33D600A26C98 /* KMCreateBatesController.xib in Resources */,
 				BB328B6E2B565BEC00B382C6 /* iVersion.bundle in Resources */,
 				BB9599C82B3164B40062D346 /* KMRedactPropertiesWindowController.xib in Resources */,
@@ -16282,6 +16294,7 @@
 				8997010B28F4082C009AF911 /* KMFromViewController.xib in Resources */,
 				BB328B622B55512F00B382C6 /* KMVerificationMessageViewController.xib in Resources */,
 				9F0CB4642966C9E200007028 /* KMFormPropertPanelViewController.xib in Resources */,
+				6536FDED2C9C49C1004A0FB9 /* KMNoteFooterCellView.xib in Resources */,
 				BBB789B62BE8BF2400F7E09C /* AIChatStringUploadItem.xib in Resources */,
 				BBFBE74B28DD7DDE008B2335 /* Main.storyboard in Resources */,
 				9F3A48CA2C8017FA0047F565 /* KMPurchaseEmbeddedWindowController.xib in Resources */,
@@ -17129,6 +17142,7 @@
 				AD1D484E2AFB8506007AC1F0 /* KMMergeTableViewCell.swift in Sources */,
 				9FDCD81D2B6CDEFE00E22166 /* KMAnnotationChoiceWidgeOptionsTextField.swift in Sources */,
 				BBEDC2272B98205200970C54 /* Bundle+KMExtension.swift in Sources */,
+				6536FDE72C9C49A6004A0FB9 /* KMNoteFooterCellView.swift in Sources */,
 				9FE0BBEB2B0F242C00CD1CAC /* NSUserDefaults_KMExtension.swift in Sources */,
 				AD02573A2A8601AA00EAD5D5 /* KMLoginManager.swift in Sources */,
 				BB332D532995D8B500CABB58 /* KMCloudDocumentTools.swift in Sources */,
@@ -18514,6 +18528,7 @@
 				BB2C84602BAE70C400AF6142 /* KMLeftSideViewSearchField.swift in Sources */,
 				9FBA0EF628FFC8A0001117AF /* KMCollectionView.swift in Sources */,
 				AD85D1A52AF09864000F4D28 /* KMHomeQuickToolsWindowController.swift in Sources */,
+				6536FDE82C9C49A6004A0FB9 /* KMNoteFooterCellView.swift in Sources */,
 				ADD1B7072946CBB600C3FFF7 /* KMBaseTextFormatter.swift in Sources */,
 				BB8F4573295ACE380037EA22 /* KMHeaderFooterAdjectiveListCell.swift in Sources */,
 				BBD54ED52A1CBD720012A230 /* NSView+KMExtension.swift in Sources */,
@@ -19446,6 +19461,7 @@
 				AD055E622B85E04C0035F824 /* KMTextWithIconCell.swift in Sources */,
 				AD055E802B88294F0035F824 /* SKBookmarkSheetController.m in Sources */,
 				ADDF835B2B391A5C00A81A4E /* CDSignatureCertificateStateViewController.swift in Sources */,
+				6536FDE92C9C49A6004A0FB9 /* KMNoteFooterCellView.swift in Sources */,
 				ADE86AB82B0343E600414DFA /* KMWatermarkView.swift in Sources */,
 				BB897277294DC04F0045787C /* KMWatermartAdjectivePageRangeView.swift in Sources */,
 				BB3A66A02B0752A800575343 /* KMTocOutlineView.swift in Sources */,