Browse Source

【UI替换】主页 最近列表 UI优化

lizhe 1 year ago
parent
commit
7ffe9c9fc5

+ 0 - 2
PDF Office/PDF Master/Class/Home/View/HomeContentView/History/Cell/KMHomeHistoryCollectionItem.swift

@@ -65,8 +65,6 @@ class KMHomeHistoryCollectionItem: NSCollectionViewItem {
     func setup() {
         self.view.wantsLayer = true;
         
-        self.iconImageView.backgroundColor(NSColor.red)
-        
         self.contentBox.border(NSColor.clear, 0, 8)
         self.contentBox.moveCallback = { [unowned self] mouseEntered, mouseBox in
             if mouseEntered {

+ 9 - 0
PDF Office/PDF Master/Class/Home/View/HomeContentView/KMHomeContentView.swift

@@ -136,6 +136,15 @@ class KMHomeContentView: KMBaseXibView {
             horizontalButton.image = NSImage(named: "KMImageNameUXIconHomeViewlistNor")
         }
     }
+    
+    override func updateUI() {
+        self.contentView.wantsLayer = true
+        if(KMAppearance.isDarkMode()){
+            self.contentView.layer?.backgroundColor = NSColor.init(red: 0.055, green: 0.067, blue: 0.078, alpha: 1).cgColor
+        } else {
+            self.contentView.layer?.backgroundColor = NSColor.init(red: 0.922, green: 0.925, blue: 0.941, alpha: 1).cgColor
+        }
+    }
 }
 
 //MARK: Action

+ 5 - 0
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -137,6 +137,7 @@ import Cocoa
         
         self.setup()
 //        refreshUI()
+        self.updateUI()
         
         NotificationCenter.default.addObserver(self, selector: #selector(homeFileRectChange(_:)), name: Notification.Name("KMHomeFileRectChange"), object: nil)
     }
@@ -357,6 +358,10 @@ import Cocoa
         dragView.delete = self
     }
     
+    func updateUI() {
+        self.leftBox.fillColor = KMAppearance.Layout.l0Color()
+    }
+    
     // MARK: Public Methods
     
     func savePDFDocument(_ pdf: CPDFDocument, password: String) -> Void {