Ver código fonte

【综合】整理代码

tangchao 5 meses atrás
pai
commit
a0d311261d

+ 8 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/View/KMSectionCellView.swift

@@ -41,6 +41,7 @@ class KMSectionCellView: NSTableCellView, NibLoadable {
     override func awakeFromNib() {
         super.awakeFromNib()
         
+        self.updateUI()
         self.expandButton.target = self
         self.expandButton.action = #selector(expandAction) 
     }
@@ -49,9 +50,7 @@ class KMSectionCellView: NSTableCellView, NibLoadable {
         self.itemClick?(1)
     }
     
-    override func updateLayer() {
-        super.updateLayer()
-        
+    func updateUI() {
         self.wantsLayer = true
         if KMAppearance.isDarkMode() {
             self.layer?.backgroundColor = NSColor(hex: "#424345").cgColor
@@ -59,4 +58,10 @@ class KMSectionCellView: NSTableCellView, NibLoadable {
             self.layer?.backgroundColor = NSColor(hex: "#EAECF2").cgColor
         }
     }
+    
+    override func updateLayer() {
+        super.updateLayer()
+        
+        self.updateUI()
+    }
 }