Kaynağa Gözat

【fix】【内容编辑】部分界面缺夜间模式

TangChao 7 ay önce
ebeveyn
işleme
1da2f330cc

+ 25 - 1
PDF Office/PDF Master/Class/PDFTools/EditPDF/Window/KMEditPDFCropComfirmWindowController.swift

@@ -21,7 +21,7 @@ class KMEditPDFCropComfirmWindowController: NSWindowController {
     override func windowDidLoad() {
         super.windowDidLoad()
         
-        self.window?.backgroundColor = .white
+//        self.window?.backgroundColor = .white
         self.window?.contentView?.wantsLayer = true
         self.window?.contentView?.layer?.cornerRadius = 4
 
@@ -47,4 +47,28 @@ class KMEditPDFCropComfirmWindowController: NSWindowController {
     @objc private func _itemClick(_ sender: NSButton) {
         self.itemAction?(sender.tag)
     }
+    
+    override func showWindow(_ sender: Any?) {
+        super.showWindow(sender)
+        
+        self.interfaceThemeDidChanged(NSApp.appearance?.name ?? .aqua)
+    }
+}
+
+extension KMEditPDFCropComfirmWindowController: KMInterfaceThemeChangedProtocol {
+    func interfaceThemeDidChanged(_ appearance: NSAppearance.Name) {
+        self.window?.appearance = .init(named: appearance)
+        
+        let isDark = appearance == .darkAqua
+        if isDark {
+            self.window?.backgroundColor = NSColor(red: 37/255.0, green: 37/255.0, blue: 38/255.0, alpha: 1.0)
+            
+            self.leftVc_?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
+            self.rightVc_?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
+        } else {
+            self.window?.backgroundColor = .white
+            self.leftVc_?.background_hov = KMAppearance.view_bg_dis_color()
+            self.rightVc_?.background_hov = KMAppearance.view_bg_dis_color()
+        }
+    }
 }

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -571,11 +571,11 @@ class KMEditPDFTextPropertyViewController: NSViewController {
             self.fontAddVC?.image_disabled = NSImage(named: "KMImageNameEditPDFFontAddDisabled")!
             self.fontAddVC?.background_disabled = NSColor(white: 96/255.0, alpha: 1.0)
             
+            self.fontReduceVC?.ignoreDisabledImage = false
+            self.fontReduceVC?.initDefaultValue()
             self.fontReduceVC?.background_act = KMAppearance.Interactive.m1Color()
             self.fontReduceVC?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
             self.fontReduceVC?.borderColor_hov = KMAppearance.Interactive.a0Color()
-            self.fontReduceVC?.ignoreDisabledImage = false
-            self.fontReduceVC?.initDefaultValue()
 //            self.fontAddVC?.background_act = KMAppearance.Interactive.m1Color()
 //            self.fontAddVC?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
 //            self.fontAddVC?.borderColor_hov = KMAppearance.Interactive.a0Color()