|
@@ -39,6 +39,8 @@ import Cocoa
|
|
|
|
|
|
deinit {
|
|
deinit {
|
|
Swift.debugPrint("KMUserFeekbackWindowController deinit.")
|
|
Swift.debugPrint("KMUserFeekbackWindowController deinit.")
|
|
|
|
+
|
|
|
|
+ DistributedNotificationCenter.default().removeObserver(self)
|
|
}
|
|
}
|
|
|
|
|
|
override func windowDidLoad() {
|
|
override func windowDidLoad() {
|
|
@@ -48,6 +50,9 @@ import Cocoa
|
|
self._initSubViews()
|
|
self._initSubViews()
|
|
|
|
|
|
self.typeItemView_?.comBoBox.selectItem(at: 0)
|
|
self.typeItemView_?.comBoBox.selectItem(at: 0)
|
|
|
|
+
|
|
|
|
+ self.updateViewColor()
|
|
|
|
+ DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged), name: NSApplication.interfaceThemeChangedNotification, object: nil)
|
|
}
|
|
}
|
|
|
|
|
|
private func _initDefaultValue() {
|
|
private func _initDefaultValue() {
|
|
@@ -58,7 +63,6 @@ import Cocoa
|
|
btn.isHidden = true
|
|
btn.isHidden = true
|
|
}
|
|
}
|
|
self.window?.title = NSLocalizedString("Feedback for PDF Reader Pro", comment: "")
|
|
self.window?.title = NSLocalizedString("Feedback for PDF Reader Pro", comment: "")
|
|
- self.window?.backgroundColor = NSColor.white
|
|
|
|
|
|
|
|
self.emailBox.borderWidth = 0
|
|
self.emailBox.borderWidth = 0
|
|
self.typeBox.borderWidth = 0
|
|
self.typeBox.borderWidth = 0
|
|
@@ -171,6 +175,30 @@ import Cocoa
|
|
self.typeItemView_?.comBoBox.stringValue = self.typeString
|
|
self.typeItemView_?.comBoBox.stringValue = self.typeString
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ func updateViewColor() {
|
|
|
|
+ if KMAppearance.isDarkMode() {
|
|
|
|
+ self.window?.backgroundColor = NSColor(red: 40/255.0, green: 40/255.0, blue: 40/255.0, alpha: 1)
|
|
|
|
+ self.emailItemView_?.box.fillColor = NSColor(red: 110/255.0, green: 109/255.0, blue: 112/255.0, alpha: 1)
|
|
|
|
+ self.typeItemView_?.comBoBox.backgroundColor = NSColor(red: 110/255.0, green: 109/255.0, blue: 112/255.0, alpha: 1)
|
|
|
|
+ self.despItemView_?.box.fillColor = NSColor(red: 110/255.0, green: 109/255.0, blue: 112/255.0, alpha: 1)
|
|
|
|
+ self.listItemView_?.tipBox.fillColor = NSColor(red: 231/255.0, green: 56/255.0, blue: 91/255.0, alpha: 1)
|
|
|
|
+ } else {
|
|
|
|
+ self.window?.backgroundColor = .white
|
|
|
|
+ self.emailItemView_?.box.fillColor = .white
|
|
|
|
+ self.typeItemView_?.comBoBox.backgroundColor = .white
|
|
|
|
+ self.despItemView_?.box.fillColor = .white
|
|
|
|
+ self.listItemView_?.tipBox.fillColor = NSColor.km_init(hex: "#FEE4EC")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // MARK: - Noti Methods
|
|
|
|
+
|
|
|
|
+ @objc func themeChanged(_ notification: Notification) {
|
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
|
|
|
+ self.updateViewColor()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// MARK: - Private Methods
|
|
// MARK: - Private Methods
|
|
|
|
|
|
@objc private func _cancelButtonAction() {
|
|
@objc private func _cancelButtonAction() {
|
|
@@ -290,6 +318,8 @@ import Cocoa
|
|
popover.setValue(true, forKey: "shouldHideAnchor")
|
|
popover.setValue(true, forKey: "shouldHideAnchor")
|
|
self.popover_ = popover
|
|
self.popover_ = popover
|
|
|
|
|
|
|
|
+ vc.isDrak = KMAppearance.isDarkMode()
|
|
|
|
+
|
|
popover.show(relativeTo: sender.bounds, of: sender, preferredEdge: .maxX)
|
|
popover.show(relativeTo: sender.bounds, of: sender, preferredEdge: .maxX)
|
|
}
|
|
}
|
|
|
|
|