Explorar o código

【综合】整理代码

tangchao hai 4 meses
pai
achega
1985cfd17d

+ 32 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMNoteTableViewCell.swift

@@ -165,7 +165,7 @@ class KMNoteTableViewCell: NSTableCellView {
     
     @IBAction func foldButtonAction(_ sender: NSButton) {
         let anno = self.model?.anno
-        if anno is CPDFStampAnnotation || anno is CPDFInkAnnotation {
+        if anno is CPDFStampAnnotation || anno is CPDFInkAnnotation || anno is CPDFSignatureAnnotation || anno is CPDFTextAnnotation {
             let expand = model?.isExpand ?? false
             if expand {
                 self.foldButton.image = NSImage(named: "KMImageNameBtnTriRightNor")
@@ -347,6 +347,13 @@ extension KMNoteTableViewCell {
                 
 //                self.isFold = isFold
 //                self.isFold = !(model?.isExpand ?? false)
+                self.isFold = true
+                let expand = model?.isExpand ?? false
+                if expand {
+                    self.foldButton.image = NSImage(named: KMImageNameUXIconBtnTriDownNor)
+                } else {
+                    self.foldButton.image = NSImage(named: "KMImageNameBtnTriRightNor")
+                }
                 self.foldButton.isHidden = false
 //                if (noteString.isEmpty == false) {
                     self.contentViewHidden(false)
@@ -377,7 +384,14 @@ extension KMNoteTableViewCell {
                     self.annotationContentLabel.isHidden = true
 //                    self.contentView.isHidden = true
                     
-                    self.isFold = !(model?.isExpand ?? false)
+//                    self.isFold = !(model?.isExpand ?? false)
+                    self.isFold = true
+                    let expand = model?.isExpand ?? false
+                    if expand {
+                        self.foldButton.image = NSImage(named: KMImageNameUXIconBtnTriDownNor)
+                    } else {
+                        self.foldButton.image = NSImage(named: "KMImageNameBtnTriRightNor")
+                    }
                     self.noteImageView.isHidden = false
                     let anno = note as! CPDFStampAnnotation
                     self.noteImageView.image = anno.stampImage()
@@ -391,7 +405,13 @@ extension KMNoteTableViewCell {
                 self.noteImageView.isHidden = false
                 self.noteImageView.image = anno.signImage
                 self.foldButton.isHidden = false
-                self.isFold = !(model?.isExpand ?? false)
+//                self.isFold = !(model?.isExpand ?? false)
+                let expand = model?.isExpand ?? false
+                if expand {
+                    self.foldButton.image = NSImage(named: KMImageNameUXIconBtnTriDownNor)
+                } else {
+                    self.foldButton.image = NSImage(named: "KMImageNameBtnTriRightNor")
+                }
                 self.contentViewHidden(false)
             } else if data.isKind(of: CPDFTextAnnotation.self) {
                 self.foldButton.isHidden = false
@@ -413,7 +433,14 @@ extension KMNoteTableViewCell {
                 }
                 
 //                self.isFold = isFold
-                self.isFold = !(model?.isExpand ?? false)
+//                self.isFold = !(model?.isExpand ?? false)
+                self.isFold = true
+                let expand = model?.isExpand ?? false
+                if expand {
+                    self.foldButton.image = NSImage(named: KMImageNameUXIconBtnTriDownNor)
+                } else {
+                    self.foldButton.image = NSImage(named: "KMImageNameBtnTriRightNor")
+                }
                 if (noteString.isEmpty == false || noteContent.isEmpty == false) {
                     self.contentView.isHidden = false
                 } else {
@@ -430,7 +457,7 @@ extension KMNoteTableViewCell {
                 self.annotationContentLabel.stringValue = noteString
             } else if data is CPDFInkAnnotation {
                 self.foldButton.isHidden = false
-//                self.isFold = true
+                self.isFold = true
 //                self.isFold = !(moxdel?.isExpand ?? false)
                 let expand = model?.isExpand ?? false
                 if expand {