|
|
@@ -382,14 +382,7 @@ class ViewController: NSViewController {
|
|
382
|
382
|
super.viewDidAppear()
|
|
383
|
383
|
if let window = view.window {
|
|
384
|
384
|
window.setContentSize(NSSize(width: 1020, height: 690))
|
|
385
|
|
- // Match the outer window background to the app background so rounded shell corners
|
|
386
|
|
- // don't reveal a lighter window color in Dark Mode.
|
|
387
|
|
- window.backgroundColor = appBackground
|
|
388
|
|
- window.isOpaque = true
|
|
389
|
|
- if let contentView = window.contentView {
|
|
390
|
|
- contentView.wantsLayer = true
|
|
391
|
|
- contentView.layer?.backgroundColor = appBackground.cgColor
|
|
392
|
|
- }
|
|
|
385
|
+ applyWindowBackgroundForCurrentTheme(window)
|
|
393
|
386
|
// Use full-size content view so custom top chrome sits in the titlebar region.
|
|
394
|
387
|
window.titleVisibility = .hidden
|
|
395
|
388
|
window.titlebarAppearsTransparent = true
|
|
|
@@ -1593,6 +1586,9 @@ class ViewController: NSViewController {
|
|
1593
|
1586
|
palette = Palette(isDarkMode: enabled)
|
|
1594
|
1587
|
NSApp.appearance = NSAppearance(named: enabled ? .darkAqua : .aqua)
|
|
1595
|
1588
|
view.appearance = NSAppearance(named: enabled ? .darkAqua : .aqua)
|
|
|
1589
|
+ if let window = view.window {
|
|
|
1590
|
+ applyWindowBackgroundForCurrentTheme(window)
|
|
|
1591
|
+ }
|
|
1596
|
1592
|
|
|
1597
|
1593
|
if isUserLoggedIn() {
|
|
1598
|
1594
|
let keepSelected = selectedHomeSidebarItem
|
|
|
@@ -1603,6 +1599,17 @@ class ViewController: NSViewController {
|
|
1603
|
1599
|
}
|
|
1604
|
1600
|
}
|
|
1605
|
1601
|
|
|
|
1602
|
+ private func applyWindowBackgroundForCurrentTheme(_ window: NSWindow) {
|
|
|
1603
|
+ // Keep the window's backing in sync with the app's current theme, otherwise rounded
|
|
|
1604
|
+ // shell corners can briefly show the previous mode's lighter/darker color.
|
|
|
1605
|
+ window.backgroundColor = appBackground
|
|
|
1606
|
+ window.isOpaque = true
|
|
|
1607
|
+ if let contentView = window.contentView {
|
|
|
1608
|
+ contentView.wantsLayer = true
|
|
|
1609
|
+ contentView.layer?.backgroundColor = appBackground.cgColor
|
|
|
1610
|
+ }
|
|
|
1611
|
+ }
|
|
|
1612
|
+
|
|
1606
|
1613
|
private func systemPrefersDarkMode() -> Bool {
|
|
1607
|
1614
|
let global = UserDefaults.standard.persistentDomain(forName: UserDefaults.globalDomain)
|
|
1608
|
1615
|
let style = global?["AppleInterfaceStyle"] as? String
|
|
|
@@ -2795,6 +2802,7 @@ class ViewController: NSViewController {
|
|
2795
|
2802
|
let title = selectedHomeSidebarItem
|
|
2796
|
2803
|
|
|
2797
|
2804
|
homeWelcomeLabel?.stringValue = title
|
|
|
2805
|
+ homeWelcomeLabel?.isHidden = isSettings
|
|
2798
|
2806
|
|
|
2799
|
2807
|
let dashboardViews: [NSView?] = [
|
|
2800
|
2808
|
homeTimeLabelView,
|
|
|
@@ -2908,7 +2916,9 @@ class ViewController: NSViewController {
|
|
2908
|
2916
|
button.isBordered = false
|
|
2909
|
2917
|
button.bezelStyle = .shadowlessSquare
|
|
2910
|
2918
|
button.focusRingType = .none
|
|
2911
|
|
- button.contentTintColor = NSColor(calibratedWhite: 0.84, alpha: 1)
|
|
|
2919
|
+ button.contentTintColor = palette.isDarkMode
|
|
|
2920
|
+ ? NSColor(calibratedWhite: 0.84, alpha: 1)
|
|
|
2921
|
+ : NSColor(calibratedWhite: 0.22, alpha: 1)
|
|
2912
|
2922
|
if let toolTip {
|
|
2913
|
2923
|
button.toolTip = toolTip
|
|
2914
|
2924
|
}
|
|
|
@@ -2932,11 +2942,19 @@ class ViewController: NSViewController {
|
|
2932
|
2942
|
button.bezelStyle = .shadowlessSquare
|
|
2933
|
2943
|
button.focusRingType = .none
|
|
2934
|
2944
|
button.wantsLayer = true
|
|
2935
|
|
- button.layer?.backgroundColor = NSColor.white.withAlphaComponent(0.06).cgColor
|
|
|
2945
|
+ button.layer?.backgroundColor = (palette.isDarkMode
|
|
|
2946
|
+ ? NSColor.white.withAlphaComponent(0.06)
|
|
|
2947
|
+ : NSColor.black.withAlphaComponent(0.06)
|
|
|
2948
|
+ ).cgColor
|
|
2936
|
2949
|
button.layer?.cornerRadius = 10
|
|
2937
|
2950
|
button.layer?.borderWidth = 1
|
|
2938
|
|
- button.layer?.borderColor = NSColor.white.withAlphaComponent(0.08).cgColor
|
|
2939
|
|
- let tint = NSColor(calibratedWhite: 0.9, alpha: 1)
|
|
|
2951
|
+ button.layer?.borderColor = (palette.isDarkMode
|
|
|
2952
|
+ ? NSColor.white.withAlphaComponent(0.08)
|
|
|
2953
|
+ : NSColor.black.withAlphaComponent(0.12)
|
|
|
2954
|
+ ).cgColor
|
|
|
2955
|
+ let tint = palette.isDarkMode
|
|
|
2956
|
+ ? NSColor(calibratedWhite: 0.9, alpha: 1)
|
|
|
2957
|
+ : NSColor(calibratedWhite: 0.18, alpha: 1)
|
|
2940
|
2958
|
let font = NSFont.systemFont(ofSize: 11, weight: .semibold)
|
|
2941
|
2959
|
button.contentTintColor = tint
|
|
2942
|
2960
|
button.font = font
|