|
@@ -65,25 +65,43 @@ class KMMemberCenterWindowController: NSWindowController {
|
|
cancelButton.title = NSLocalizedString("Do not log in to the current device", tableName: "MemberCenterLocalizable", comment: "")
|
|
cancelButton.title = NSLocalizedString("Do not log in to the current device", tableName: "MemberCenterLocalizable", comment: "")
|
|
loginButton.title = NSLocalizedString("Log in to the current device", tableName: "MemberCenterLocalizable", comment: "")
|
|
loginButton.title = NSLocalizedString("Log in to the current device", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
|
|
|
|
+ productView.wantsLayer = true
|
|
|
|
+ device1View.wantsLayer = true
|
|
|
|
+ device2View.wantsLayer = true
|
|
|
|
+ device3View.wantsLayer = true
|
|
|
|
+ device4View.wantsLayer = true
|
|
|
|
+
|
|
initializeUI()
|
|
initializeUI()
|
|
|
|
|
|
- DistributedNotificationCenter.default.addObserver(self, selector: #selector(themeChanged(_:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
|
|
|
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(changeEffectiveAppearance), name: NSNotification.Name(rawValue: "kEffectiveAppearance"), object: nil)
|
|
}
|
|
}
|
|
|
|
|
|
- @objc func themeChanged(_ notification: Notification) {
|
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
|
|
|
|
|
+ @objc func changeEffectiveAppearance() {
|
|
self.initializeUI()
|
|
self.initializeUI()
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private func initializeUI() -> Void {
|
|
private func initializeUI() -> Void {
|
|
self.window?.contentView?.wantsLayer = true
|
|
self.window?.contentView?.wantsLayer = true
|
|
let isDarkModel = KMAdvertisementConfig.isDarkModel()
|
|
let isDarkModel = KMAdvertisementConfig.isDarkModel()
|
|
|
|
+ var proColor = NSColor(hex: "323232")
|
|
|
|
+ var prosubColor = NSColor(hex: "272727")
|
|
|
|
+
|
|
if isDarkModel {
|
|
if isDarkModel {
|
|
- self.window?.contentView?.layer?.backgroundColor = NSColor(hex: "282828").cgColor;
|
|
|
|
|
|
+ self.window?.contentView?.layer?.backgroundColor = NSColor(hex: "282828").cgColor
|
|
|
|
+ proColor = NSColor(hex: "323232")
|
|
|
|
+ prosubColor = NSColor(hex: "272727")
|
|
} else {
|
|
} else {
|
|
self.window?.contentView?.layer?.backgroundColor = NSColor(hex: "f6f6f6").cgColor;
|
|
self.window?.contentView?.layer?.backgroundColor = NSColor(hex: "f6f6f6").cgColor;
|
|
|
|
+ proColor = NSColor(hex: "E4E4E4")
|
|
|
|
+ prosubColor = NSColor(hex: "F0F0F0")
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ productView.layer?.backgroundColor = proColor.cgColor
|
|
|
|
+ device1View.layer?.backgroundColor = prosubColor.cgColor
|
|
|
|
+ device2View.layer?.backgroundColor = prosubColor.cgColor
|
|
|
|
+ device3View.layer?.backgroundColor = prosubColor.cgColor
|
|
|
|
+ device4View.layer?.backgroundColor = prosubColor.cgColor
|
|
|
|
+
|
|
productBox.borderColor = NSColor(named: "DADBDE") ?? .gray
|
|
productBox.borderColor = NSColor(named: "DADBDE") ?? .gray
|
|
|
|
|
|
productLabel.textColor = NSColor(named: "42464D")
|
|
productLabel.textColor = NSColor(named: "42464D")
|
|
@@ -95,21 +113,7 @@ class KMMemberCenterWindowController: NSWindowController {
|
|
tipLabel.textColor = NSColor(named: "4982E6")
|
|
tipLabel.textColor = NSColor(named: "4982E6")
|
|
|
|
|
|
cancelButton.setTitleColor(color: NSColor(named: "000000") ?? NSColor.white, font: NSFont.SFProTextRegularFont(13))
|
|
cancelButton.setTitleColor(color: NSColor(named: "000000") ?? NSColor.white, font: NSFont.SFProTextRegularFont(13))
|
|
-
|
|
|
|
- productView.wantsLayer = true
|
|
|
|
- productView.layer?.backgroundColor = NSColor(named: "000000_0.05")?.cgColor
|
|
|
|
-
|
|
|
|
- device1View.wantsLayer = true
|
|
|
|
- device1View.layer?.backgroundColor = NSColor(named: "000000_0.76")?.cgColor
|
|
|
|
|
|
|
|
- device2View.wantsLayer = true
|
|
|
|
- device2View.layer?.backgroundColor = NSColor(named: "000000_0.76")?.cgColor
|
|
|
|
-
|
|
|
|
- device3View.wantsLayer = true
|
|
|
|
- device3View.layer?.backgroundColor = NSColor(named: "000000_0.76")?.cgColor
|
|
|
|
-
|
|
|
|
- device4View.wantsLayer = true
|
|
|
|
- device4View.layer?.backgroundColor = NSColor(named: "000000_0.76")?.cgColor
|
|
|
|
device1Button.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.blue, font: NSFont.SFProTextRegularFont(13))
|
|
device1Button.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.blue, font: NSFont.SFProTextRegularFont(13))
|
|
device2Button.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.blue, font: NSFont.SFProTextRegularFont(13))
|
|
device2Button.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.blue, font: NSFont.SFProTextRegularFont(13))
|
|
device3Button.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.blue, font: NSFont.SFProTextRegularFont(13))
|
|
device3Button.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.blue, font: NSFont.SFProTextRegularFont(13))
|
|
@@ -156,10 +160,14 @@ class KMMemberCenterWindowController: NSWindowController {
|
|
device4Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
|
|
device4Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ let maxDeviceNum = memberCenterdeviceResult.maxDeviceNum ?? 1
|
|
|
|
+ if (maxDeviceNum <= 1) {
|
|
|
|
+ tipLabel.stringValue = String(format: NSLocalizedString("Can keep %d device online at the same time", tableName: "MemberCenterLocalizable", comment: ""), maxDeviceNum)
|
|
|
|
+ } else {
|
|
|
|
+ tipLabel.stringValue = String(format: NSLocalizedString("Can keep %d devices online at the same time", tableName: "MemberCenterLocalizable", comment: ""), maxDeviceNum)
|
|
|
|
+ }
|
|
|
|
|
|
- tipLabel.stringValue = String(format: NSLocalizedString("Can keep %d devices online at the same time", tableName: "MemberCenterLocalizable", comment: ""), memberCenterdeviceResult.maxDeviceNum ?? 1)
|
|
|
|
-
|
|
|
|
- if deviceList_Result.count == memberCenterdeviceResult.maxDeviceNum {
|
|
|
|
|
|
+ if deviceList_Result.count == maxDeviceNum {
|
|
loginButton.isEnabled = false
|
|
loginButton.isEnabled = false
|
|
} else {
|
|
} else {
|
|
loginButton.isEnabled = true
|
|
loginButton.isEnabled = true
|