Browse Source

【综合】暗黑 工具栏(已修复)

tangchao 11 months ago
parent
commit
5f22ef7c13

+ 1 - 7
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -180,7 +180,6 @@ class KMToolbarController: NSViewController {
         toolbarType = .None
         mainToolBarView?.toolbarType = .Main
         mainToolBarView?.reloadateToolbar()
-        addObserverForAppearanceChange()
         
         NotificationCenter.default.addObserver(self, selector: #selector(selectedShapAnnotationChangeNotification(_:)), name: NSNotification.Name.init(rawValue: "KMSelectedShapAnnotationChangeNotification"), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(PDFChangedNotification(_:)), name: NSNotification.Name.init(rawValue: "PDFChangedNotification"), object: nil)
@@ -248,12 +247,6 @@ class KMToolbarController: NSViewController {
         }
     }
     
-    // MARK: Dark&Light
-    
-    func addObserverForAppearanceChange() -> Void {
-        
-    }
-    
     // MARK: -
     // MARK: Public Methods
     
@@ -584,6 +577,7 @@ class KMToolbarController: NSViewController {
         super.interfaceThemeDidChanged(appearance)
         
         self.mainToolBarView?.interfaceThemeDidChanged(appearance)
+        self.childToolBarView?.interfaceThemeDidChanged(appearance)
     }
 }
 

+ 6 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -554,6 +554,12 @@ class KMToolbarViewController: NSViewController, NSTextFieldDelegate {
         super.interfaceThemeDidChanged(appearance)
         
         self.toolbar?.appearance = .init(named: appearance)
+        self.bottomLine.wantsLayer = true
+        if KMAppearance.isDarkMode() {
+            self.bottomLine.layer?.backgroundColor = NSColor.km_init(hex: "#393B3E", alpha: 1).cgColor
+        } else {
+            self.bottomLine.layer?.backgroundColor = NSColor.km_init(hex: "#0000001A").cgColor
+        }
     }
 }