|
|
@@ -36,7 +36,7 @@ private enum PremiumPlan: Int {
|
|
36
|
36
|
}
|
|
37
|
37
|
|
|
38
|
38
|
final class ViewController: NSViewController {
|
|
39
|
|
- private let palette = Palette()
|
|
|
39
|
+ private var palette = Palette(isDarkMode: true)
|
|
40
|
40
|
private let typography = Typography()
|
|
41
|
41
|
private let launchContentSize = NSSize(width: 920, height: 690)
|
|
42
|
42
|
private let launchMinContentSize = NSSize(width: 760, height: 600)
|
|
|
@@ -56,6 +56,7 @@ final class ViewController: NSViewController {
|
|
56
|
56
|
private var selectedPremiumPlan: PremiumPlan = .monthly
|
|
57
|
57
|
private var paywallPlanViews: [PremiumPlan: NSView] = [:]
|
|
58
|
58
|
private var premiumPlanByView = [ObjectIdentifier: PremiumPlan]()
|
|
|
59
|
+ private weak var paywallOfferLabel: NSTextField?
|
|
59
|
60
|
|
|
60
|
61
|
private let darkModeDefaultsKey = "settings.darkModeEnabled"
|
|
61
|
62
|
private var darkModeEnabled: Bool {
|
|
|
@@ -66,7 +67,7 @@ final class ViewController: NSViewController {
|
|
66
|
67
|
set { UserDefaults.standard.set(newValue, forKey: darkModeDefaultsKey) }
|
|
67
|
68
|
}
|
|
68
|
69
|
|
|
69
|
|
- private lazy var settingsPopover: NSPopover = {
|
|
|
70
|
+ private func makeSettingsPopover() -> NSPopover {
|
|
70
|
71
|
let popover = NSPopover()
|
|
71
|
72
|
popover.behavior = .transient
|
|
72
|
73
|
popover.animates = true
|
|
|
@@ -82,10 +83,13 @@ final class ViewController: NSViewController {
|
|
82
|
83
|
}
|
|
83
|
84
|
)
|
|
84
|
85
|
return popover
|
|
85
|
|
- }()
|
|
|
86
|
+ }
|
|
|
87
|
+
|
|
|
88
|
+ private var settingsPopover: NSPopover?
|
|
86
|
89
|
|
|
87
|
90
|
override func viewDidLoad() {
|
|
88
|
91
|
super.viewDidLoad()
|
|
|
92
|
+ palette = Palette(isDarkMode: darkModeEnabled)
|
|
89
|
93
|
setupRootView()
|
|
90
|
94
|
buildMainLayout()
|
|
91
|
95
|
}
|
|
|
@@ -195,22 +199,44 @@ private extension ViewController {
|
|
195
|
199
|
|
|
196
|
200
|
private func showSettingsPopover() {
|
|
197
|
201
|
guard let anchor = sidebarRowViews[.settings] else { return }
|
|
198
|
|
- if settingsPopover.isShown {
|
|
199
|
|
- settingsPopover.performClose(nil)
|
|
|
202
|
+ if settingsPopover?.isShown == true {
|
|
|
203
|
+ settingsPopover?.performClose(nil)
|
|
200
|
204
|
return
|
|
201
|
205
|
}
|
|
202
|
206
|
|
|
203
|
|
- if let menu = settingsPopover.contentViewController as? SettingsMenuViewController {
|
|
|
207
|
+ settingsPopover = makeSettingsPopover()
|
|
|
208
|
+ if let menu = settingsPopover?.contentViewController as? SettingsMenuViewController {
|
|
204
|
209
|
menu.setDarkModeEnabled(darkModeEnabled)
|
|
205
|
210
|
}
|
|
206
|
211
|
|
|
207
|
|
- settingsPopover.show(relativeTo: anchor.bounds, of: anchor, preferredEdge: .maxX)
|
|
|
212
|
+ settingsPopover?.show(relativeTo: anchor.bounds, of: anchor, preferredEdge: .maxX)
|
|
208
|
213
|
}
|
|
209
|
214
|
|
|
210
|
215
|
private func setDarkMode(_ enabled: Bool) {
|
|
211
|
216
|
darkModeEnabled = enabled
|
|
212
|
217
|
NSApp.appearance = NSAppearance(named: enabled ? .darkAqua : .aqua)
|
|
213
|
218
|
view.appearance = NSAppearance(named: enabled ? .darkAqua : .aqua)
|
|
|
219
|
+ palette = Palette(isDarkMode: enabled)
|
|
|
220
|
+ settingsPopover?.performClose(nil)
|
|
|
221
|
+ settingsPopover = nil
|
|
|
222
|
+ reloadTheme()
|
|
|
223
|
+ }
|
|
|
224
|
+
|
|
|
225
|
+ private func reloadTheme() {
|
|
|
226
|
+ pageCache.removeAll()
|
|
|
227
|
+ sidebarRowViews.removeAll()
|
|
|
228
|
+ sidebarPageByView.removeAll()
|
|
|
229
|
+ zoomJoinModeByView.removeAll()
|
|
|
230
|
+ zoomJoinModeViews.removeAll()
|
|
|
231
|
+ settingsActionByView.removeAll()
|
|
|
232
|
+ paywallPlanViews.removeAll()
|
|
|
233
|
+ premiumPlanByView.removeAll()
|
|
|
234
|
+
|
|
|
235
|
+ mainContentHost = nil
|
|
|
236
|
+ view.subviews.forEach { $0.removeFromSuperview() }
|
|
|
237
|
+ setupRootView()
|
|
|
238
|
+ buildMainLayout()
|
|
|
239
|
+ showSidebarPage(selectedSidebarPage)
|
|
214
|
240
|
}
|
|
215
|
241
|
|
|
216
|
242
|
private func handleSettingsAction(_ action: SettingsAction) {
|
|
|
@@ -294,19 +320,35 @@ private extension ViewController {
|
|
294
|
320
|
for (plan, view) in paywallPlanViews {
|
|
295
|
321
|
applyPaywallPlanStyle(view, isSelected: plan == selectedPremiumPlan)
|
|
296
|
322
|
}
|
|
|
323
|
+ paywallOfferLabel?.stringValue = paywallOfferText(for: selectedPremiumPlan)
|
|
|
324
|
+ }
|
|
|
325
|
+
|
|
|
326
|
+ private func paywallOfferText(for plan: PremiumPlan) -> String {
|
|
|
327
|
+ switch plan {
|
|
|
328
|
+ case .weekly:
|
|
|
329
|
+ return "Rs 1,100.00/week"
|
|
|
330
|
+ case .monthly:
|
|
|
331
|
+ return "Free for 3 Days then Rs 2,500.00/month"
|
|
|
332
|
+ case .yearly:
|
|
|
333
|
+ return "Rs 9,900.00/year (about 190.38/week)"
|
|
|
334
|
+ case .lifetime:
|
|
|
335
|
+ return "Rs 14,900.00 one-time purchase"
|
|
|
336
|
+ }
|
|
297
|
337
|
}
|
|
298
|
338
|
|
|
299
|
339
|
private func applyPaywallPlanStyle(_ card: NSView, isSelected: Bool) {
|
|
300
|
340
|
let selectedBorder = NSColor(calibratedRed: 1.0, green: 0.60, blue: 0.20, alpha: 1)
|
|
301
|
341
|
let idleBorder = palette.inputBorder
|
|
302
|
|
- let selectedBackground = NSColor(calibratedRed: 30.0 / 255.0, green: 34.0 / 255.0, blue: 42.0 / 255.0, alpha: 1)
|
|
|
342
|
+ let selectedBackground = darkModeEnabled
|
|
|
343
|
+ ? NSColor(calibratedRed: 30.0 / 255.0, green: 34.0 / 255.0, blue: 42.0 / 255.0, alpha: 1)
|
|
|
344
|
+ : NSColor(calibratedRed: 255.0 / 255.0, green: 246.0 / 255.0, blue: 236.0 / 255.0, alpha: 1)
|
|
303
|
345
|
card.layer?.backgroundColor = (isSelected ? selectedBackground : palette.sectionCard).cgColor
|
|
304
|
346
|
card.layer?.borderColor = (isSelected ? selectedBorder : idleBorder).cgColor
|
|
305
|
347
|
card.layer?.borderWidth = isSelected ? 2 : 1
|
|
306
|
348
|
card.layer?.shadowColor = NSColor.black.cgColor
|
|
307
|
|
- card.layer?.shadowOpacity = isSelected ? 0.26 : 0.12
|
|
|
349
|
+ card.layer?.shadowOpacity = isSelected ? (darkModeEnabled ? 0.26 : 0.10) : 0.12
|
|
308
|
350
|
card.layer?.shadowOffset = CGSize(width: 0, height: -1)
|
|
309
|
|
- card.layer?.shadowRadius = isSelected ? 10 : 5
|
|
|
351
|
+ card.layer?.shadowRadius = isSelected ? (darkModeEnabled ? 10 : 6) : 5
|
|
310
|
352
|
}
|
|
311
|
353
|
|
|
312
|
354
|
private func viewForPage(_ page: SidebarPage) -> NSView {
|
|
|
@@ -435,14 +477,14 @@ private extension ViewController {
|
|
435
|
477
|
menuStack.addArrangedSubview(joinRow)
|
|
436
|
478
|
sidebarRowViews[.joinMeetings] = joinRow
|
|
437
|
479
|
menuStack.addArrangedSubview(sidebarSectionTitle("Backgrounds"))
|
|
438
|
|
- let photoRow = sidebarItem("Photo", icon: "", page: .photo, logoImageName: "SidebarPhotoLogo", logoIconWidth: 24, logoHeightMultiplier: 82.0 / 62.0, logoTemplate: false)
|
|
|
480
|
+ let photoRow = sidebarItem("Photo", icon: "", page: .photo, logoImageName: "SidebarPhotoLogo", logoIconWidth: 24, logoHeightMultiplier: 82.0 / 62.0)
|
|
439
|
481
|
menuStack.addArrangedSubview(photoRow)
|
|
440
|
482
|
sidebarRowViews[.photo] = photoRow
|
|
441
|
483
|
let videoRow = sidebarItem("Video", icon: "", page: .video, logoImageName: "SidebarVideoLogo", logoIconWidth: 28, logoHeightMultiplier: 52.0 / 60.0)
|
|
442
|
484
|
menuStack.addArrangedSubview(videoRow)
|
|
443
|
485
|
sidebarRowViews[.video] = videoRow
|
|
444
|
486
|
menuStack.addArrangedSubview(sidebarSectionTitle("Additional"))
|
|
445
|
|
- let tutorialsRow = sidebarItem("Tutorials", icon: "", page: .tutorials, logoImageName: "SidebarTutorialsLogo", logoIconWidth: 24, logoHeightMultiplier: 50.0 / 60.0, logoTemplate: false)
|
|
|
487
|
+ let tutorialsRow = sidebarItem("Tutorials", icon: "", page: .tutorials, logoImageName: "SidebarTutorialsLogo", logoIconWidth: 24, logoHeightMultiplier: 50.0 / 60.0)
|
|
446
|
488
|
menuStack.addArrangedSubview(tutorialsRow)
|
|
447
|
489
|
sidebarRowViews[.tutorials] = tutorialsRow
|
|
448
|
490
|
let settingsRow = sidebarItem("Settings", icon: "", page: .settings, logoImageName: "SidebarSettingsLogo", logoIconWidth: 28, logoHeightMultiplier: 68.0 / 62.0, showsDisclosure: true)
|
|
|
@@ -500,7 +542,8 @@ private extension ViewController {
|
|
500
|
542
|
])
|
|
501
|
543
|
|
|
502
|
544
|
let baseColor = palette.primaryBlue
|
|
503
|
|
- let hoverColor = baseColor.blended(withFraction: 0.10, of: NSColor.white) ?? baseColor
|
|
|
545
|
+ let hoverBlend = darkModeEnabled ? NSColor.white : NSColor.black
|
|
|
546
|
+ let hoverColor = baseColor.blended(withFraction: 0.10, of: hoverBlend) ?? baseColor
|
|
504
|
547
|
button.onHoverChanged = { hovering in
|
|
505
|
548
|
button.layer?.backgroundColor = (hovering ? hoverColor : baseColor).cgColor
|
|
506
|
549
|
}
|
|
|
@@ -648,7 +691,8 @@ private extension ViewController {
|
|
648
|
691
|
])
|
|
649
|
692
|
|
|
650
|
693
|
let baseColor = palette.sectionCard
|
|
651
|
|
- let hoverColor = baseColor.blended(withFraction: 0.10, of: NSColor.white) ?? baseColor
|
|
|
694
|
+ let hoverBlend = darkModeEnabled ? NSColor.white : NSColor.black
|
|
|
695
|
+ let hoverColor = baseColor.blended(withFraction: 0.10, of: hoverBlend) ?? baseColor
|
|
652
|
696
|
instant.onHoverChanged = { hovering in
|
|
653
|
697
|
instant.layer?.backgroundColor = (hovering ? hoverColor : baseColor).cgColor
|
|
654
|
698
|
}
|
|
|
@@ -763,8 +807,9 @@ private extension ViewController {
|
|
763
|
807
|
updatePaywallPlanSelection()
|
|
764
|
808
|
contentStack.setCustomSpacing(20, after: lifetimeCard)
|
|
765
|
809
|
|
|
766
|
|
- let offer = textLabel("Free for 3 Days then Rs 2,500.00/month", font: NSFont.systemFont(ofSize: 13, weight: .semibold), color: palette.textPrimary)
|
|
|
810
|
+ let offer = textLabel(paywallOfferText(for: selectedPremiumPlan), font: NSFont.systemFont(ofSize: 13, weight: .semibold), color: palette.textPrimary)
|
|
767
|
811
|
offer.alignment = .center
|
|
|
812
|
+ paywallOfferLabel = offer
|
|
768
|
813
|
let offerWrap = NSView()
|
|
769
|
814
|
offerWrap.translatesAutoresizingMaskIntoConstraints = false
|
|
770
|
815
|
offerWrap.addSubview(offer)
|
|
|
@@ -948,7 +993,7 @@ private extension ViewController {
|
|
948
|
993
|
let click = NSClickGestureRecognizer(target: self, action: #selector(paywallFooterLinkClicked(_:)))
|
|
949
|
994
|
container.addGestureRecognizer(click)
|
|
950
|
995
|
container.onHoverChanged = { hovering in
|
|
951
|
|
- label.textColor = hovering ? .white : self.palette.textSecondary
|
|
|
996
|
+ label.textColor = hovering ? (self.darkModeEnabled ? .white : self.palette.textPrimary) : self.palette.textSecondary
|
|
952
|
997
|
}
|
|
953
|
998
|
container.onHoverChanged?(false)
|
|
954
|
999
|
return container
|
|
|
@@ -1573,8 +1618,8 @@ private final class SettingsMenuViewController: NSViewController {
|
|
1573
|
1618
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
1574
|
1619
|
view.wantsLayer = true
|
|
1575
|
1620
|
view.layer?.cornerRadius = 12
|
|
1576
|
|
- view.layer?.backgroundColor = NSColor(calibratedWhite: 0.12, alpha: 1).cgColor
|
|
1577
|
|
- view.layer?.borderColor = NSColor(calibratedWhite: 0.22, alpha: 1).cgColor
|
|
|
1621
|
+ view.layer?.backgroundColor = palette.sectionCard.cgColor
|
|
|
1622
|
+ view.layer?.borderColor = palette.inputBorder.cgColor
|
|
1578
|
1623
|
view.layer?.borderWidth = 1
|
|
1579
|
1624
|
view.layer?.shadowColor = NSColor.black.cgColor
|
|
1580
|
1625
|
view.layer?.shadowOpacity = 0.28
|
|
|
@@ -1584,19 +1629,21 @@ private final class SettingsMenuViewController: NSViewController {
|
|
1584
|
1629
|
}
|
|
1585
|
1630
|
|
|
1586
|
1631
|
private func settingsDarkModeRow(enabled: Bool) -> NSView {
|
|
1587
|
|
- let row = HoverTrackingView()
|
|
|
1632
|
+ let row = NSView()
|
|
1588
|
1633
|
row.translatesAutoresizingMaskIntoConstraints = false
|
|
1589
|
1634
|
row.heightAnchor.constraint(equalToConstant: 44).isActive = true
|
|
|
1635
|
+ row.wantsLayer = true
|
|
|
1636
|
+ row.layer?.cornerRadius = 10
|
|
1590
|
1637
|
|
|
1591
|
1638
|
let icon = NSTextField(labelWithString: "◐")
|
|
1592
|
1639
|
icon.translatesAutoresizingMaskIntoConstraints = false
|
|
1593
|
1640
|
icon.font = NSFont.systemFont(ofSize: 18, weight: .medium)
|
|
1594
|
|
- icon.textColor = .white
|
|
|
1641
|
+ icon.textColor = palette.textPrimary
|
|
1595
|
1642
|
|
|
1596
|
1643
|
let title = NSTextField(labelWithString: "Dark Mode")
|
|
1597
|
1644
|
title.translatesAutoresizingMaskIntoConstraints = false
|
|
1598
|
1645
|
title.font = NSFont.systemFont(ofSize: 16, weight: .semibold)
|
|
1599
|
|
- title.textColor = .white
|
|
|
1646
|
+ title.textColor = palette.textPrimary
|
|
1600
|
1647
|
|
|
1601
|
1648
|
let toggle = NSSwitch()
|
|
1602
|
1649
|
toggle.translatesAutoresizingMaskIntoConstraints = false
|
|
|
@@ -1608,12 +1655,7 @@ private final class SettingsMenuViewController: NSViewController {
|
|
1608
|
1655
|
row.addSubview(icon)
|
|
1609
|
1656
|
row.addSubview(title)
|
|
1610
|
1657
|
row.addSubview(toggle)
|
|
1611
|
|
- row.onHoverChanged = { hovering in
|
|
1612
|
|
- row.wantsLayer = true
|
|
1613
|
|
- row.layer?.cornerRadius = 10
|
|
1614
|
|
- row.layer?.backgroundColor = (hovering ? NSColor(calibratedWhite: 1, alpha: 0.06) : NSColor.clear).cgColor
|
|
1615
|
|
- }
|
|
1616
|
|
- row.onHoverChanged?(false)
|
|
|
1658
|
+ row.layer?.backgroundColor = NSColor.clear.cgColor
|
|
1617
|
1659
|
|
|
1618
|
1660
|
NSLayoutConstraint.activate([
|
|
1619
|
1661
|
icon.leadingAnchor.constraint(equalTo: row.leadingAnchor, constant: 4),
|
|
|
@@ -1637,12 +1679,12 @@ private final class SettingsMenuViewController: NSViewController {
|
|
1637
|
1679
|
let iconLabel = NSTextField(labelWithString: icon)
|
|
1638
|
1680
|
iconLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
1639
|
1681
|
iconLabel.font = NSFont.systemFont(ofSize: 18, weight: .medium)
|
|
1640
|
|
- iconLabel.textColor = .white
|
|
|
1682
|
+ iconLabel.textColor = palette.textPrimary
|
|
1641
|
1683
|
|
|
1642
|
1684
|
let titleLabel = NSTextField(labelWithString: title)
|
|
1643
|
1685
|
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
1644
|
1686
|
titleLabel.font = NSFont.systemFont(ofSize: 16, weight: .semibold)
|
|
1645
|
|
- titleLabel.textColor = .white
|
|
|
1687
|
+ titleLabel.textColor = palette.textPrimary
|
|
1646
|
1688
|
|
|
1647
|
1689
|
row.addSubview(iconLabel)
|
|
1648
|
1690
|
row.addSubview(titleLabel)
|
|
|
@@ -1660,7 +1702,7 @@ private final class SettingsMenuViewController: NSViewController {
|
|
1660
|
1702
|
row.onHoverChanged = { hovering in
|
|
1661
|
1703
|
row.wantsLayer = true
|
|
1662
|
1704
|
row.layer?.cornerRadius = 10
|
|
1663
|
|
- row.layer?.backgroundColor = (hovering ? NSColor(calibratedWhite: 1, alpha: 0.06) : NSColor.clear).cgColor
|
|
|
1705
|
+ row.layer?.backgroundColor = (hovering ? self.palette.inputBackground : NSColor.clear).cgColor
|
|
1664
|
1706
|
}
|
|
1665
|
1707
|
row.onHoverChanged?(false)
|
|
1666
|
1708
|
|
|
|
@@ -1732,6 +1774,7 @@ private extension ViewController {
|
|
1732
|
1774
|
|
|
1733
|
1775
|
let leadingView: NSView
|
|
1734
|
1776
|
if let name = logoImageName, let logo = NSImage(named: name) {
|
|
|
1777
|
+ logo.isTemplate = true
|
|
1735
|
1778
|
let imageView = NSImageView(image: logo)
|
|
1736
|
1779
|
imageView.translatesAutoresizingMaskIntoConstraints = false
|
|
1737
|
1780
|
imageView.imageScaling = .scaleProportionallyDown
|
|
|
@@ -1792,23 +1835,24 @@ private extension ViewController {
|
|
1792
|
1835
|
|
|
1793
|
1836
|
func applySidebarRowStyle(_ item: NSView, page: SidebarPage, logoTemplate: Bool, hovering: Bool = false) {
|
|
1794
|
1837
|
let selected = (page == selectedSidebarPage)
|
|
1795
|
|
- let hoverColor = NSColor(calibratedWhite: 1, alpha: 0.07)
|
|
|
1838
|
+ let hoverColor = darkModeEnabled ? NSColor(calibratedWhite: 1, alpha: 0.07) : NSColor(calibratedWhite: 0, alpha: 0.08)
|
|
1796
|
1839
|
item.layer?.backgroundColor = (selected ? palette.primaryBlue : (hovering ? hoverColor : NSColor.clear)).cgColor
|
|
1797
|
1840
|
let tint = selected ? NSColor.white : palette.textSecondary
|
|
|
1841
|
+ let sidebarIconTint = darkModeEnabled ? tint : NSColor.black
|
|
1798
|
1842
|
guard item.subviews.count >= 2 else { return }
|
|
1799
|
1843
|
let leading = item.subviews[0]
|
|
1800
|
1844
|
let title = item.subviews.first { $0 is NSTextField } as? NSTextField
|
|
1801
|
1845
|
title?.textColor = tint
|
|
1802
|
1846
|
// Optional disclosure chevron (if present) is the last text field.
|
|
1803
|
1847
|
if let chevron = item.subviews.last as? NSTextField, chevron !== title {
|
|
1804
|
|
- chevron.textColor = tint
|
|
|
1848
|
+ chevron.textColor = sidebarIconTint
|
|
1805
|
1849
|
}
|
|
1806
|
1850
|
if let imageView = leading as? NSImageView {
|
|
1807
|
1851
|
if logoTemplate {
|
|
1808
|
|
- imageView.contentTintColor = tint
|
|
|
1852
|
+ imageView.contentTintColor = sidebarIconTint
|
|
1809
|
1853
|
}
|
|
1810
|
1854
|
} else if let iconField = leading as? NSTextField {
|
|
1811
|
|
- iconField.textColor = tint
|
|
|
1855
|
+ iconField.textColor = sidebarIconTint
|
|
1812
|
1856
|
}
|
|
1813
|
1857
|
}
|
|
1814
|
1858
|
|
|
|
@@ -1833,7 +1877,8 @@ private extension ViewController {
|
|
1833
|
1877
|
])
|
|
1834
|
1878
|
|
|
1835
|
1879
|
let baseColor = (title == "Cancel") ? palette.cancelButton : color
|
|
1836
|
|
- let hoverColor = baseColor.blended(withFraction: 0.12, of: NSColor.white) ?? baseColor
|
|
|
1880
|
+ let hoverBlend = darkModeEnabled ? NSColor.white : NSColor.black
|
|
|
1881
|
+ let hoverColor = baseColor.blended(withFraction: 0.12, of: hoverBlend) ?? baseColor
|
|
1837
|
1882
|
button.onHoverChanged = { hovering in
|
|
1838
|
1883
|
button.layer?.backgroundColor = (hovering ? hoverColor : baseColor).cgColor
|
|
1839
|
1884
|
}
|
|
|
@@ -1860,7 +1905,8 @@ private extension ViewController {
|
|
1860
|
1905
|
])
|
|
1861
|
1906
|
|
|
1862
|
1907
|
let baseColor = palette.inputBackground
|
|
1863
|
|
- let hoverColor = baseColor.blended(withFraction: 0.10, of: NSColor.white) ?? baseColor
|
|
|
1908
|
+ let hoverBlend = darkModeEnabled ? NSColor.white : NSColor.black
|
|
|
1909
|
+ let hoverColor = baseColor.blended(withFraction: 0.10, of: hoverBlend) ?? baseColor
|
|
1864
|
1910
|
button.onHoverChanged = { hovering in
|
|
1865
|
1911
|
button.layer?.backgroundColor = (hovering ? hoverColor : baseColor).cgColor
|
|
1866
|
1912
|
}
|
|
|
@@ -1871,22 +1917,60 @@ private extension ViewController {
|
|
1871
|
1917
|
}
|
|
1872
|
1918
|
|
|
1873
|
1919
|
private struct Palette {
|
|
1874
|
|
- let pageBackground = NSColor(calibratedRed: 10.0 / 255.0, green: 11.0 / 255.0, blue: 12.0 / 255.0, alpha: 1)
|
|
1875
|
|
- let sidebarBackground = NSColor(calibratedRed: 16.0 / 255.0, green: 17.0 / 255.0, blue: 19.0 / 255.0, alpha: 1)
|
|
1876
|
|
- let sectionCard = NSColor(calibratedRed: 22.0 / 255.0, green: 23.0 / 255.0, blue: 26.0 / 255.0, alpha: 1)
|
|
1877
|
|
- let tabBarBackground = NSColor(calibratedRed: 22.0 / 255.0, green: 23.0 / 255.0, blue: 26.0 / 255.0, alpha: 1)
|
|
1878
|
|
- let tabIdleBackground = NSColor(calibratedRed: 22.0 / 255.0, green: 23.0 / 255.0, blue: 26.0 / 255.0, alpha: 1)
|
|
1879
|
|
- let inputBackground = NSColor(calibratedRed: 20.0 / 255.0, green: 21.0 / 255.0, blue: 24.0 / 255.0, alpha: 1)
|
|
1880
|
|
- let inputBorder = NSColor(calibratedRed: 38.0 / 255.0, green: 40.0 / 255.0, blue: 44.0 / 255.0, alpha: 1)
|
|
1881
|
|
- let primaryBlue = NSColor(calibratedRed: 27.0 / 255.0, green: 115.0 / 255.0, blue: 232.0 / 255.0, alpha: 1)
|
|
1882
|
|
- let primaryBlueBorder = NSColor(calibratedRed: 42.0 / 255.0, green: 118.0 / 255.0, blue: 220.0 / 255.0, alpha: 1)
|
|
1883
|
|
- let cancelButton = NSColor(calibratedRed: 20.0 / 255.0, green: 21.0 / 255.0, blue: 24.0 / 255.0, alpha: 1)
|
|
1884
|
|
- let meetingBadge = NSColor(calibratedRed: 0.88, green: 0.66, blue: 0.14, alpha: 1)
|
|
1885
|
|
- let separator = NSColor(calibratedRed: 26.0 / 255.0, green: 27.0 / 255.0, blue: 30.0 / 255.0, alpha: 1)
|
|
1886
|
|
- let textPrimary = NSColor(calibratedWhite: 0.98, alpha: 1)
|
|
1887
|
|
- let textSecondary = NSColor(calibratedWhite: 0.78, alpha: 1)
|
|
1888
|
|
- let textTertiary = NSColor(calibratedWhite: 0.66, alpha: 1)
|
|
1889
|
|
- let textMuted = NSColor(calibratedWhite: 0.44, alpha: 1)
|
|
|
1920
|
+ let pageBackground: NSColor
|
|
|
1921
|
+ let sidebarBackground: NSColor
|
|
|
1922
|
+ let sectionCard: NSColor
|
|
|
1923
|
+ let tabBarBackground: NSColor
|
|
|
1924
|
+ let tabIdleBackground: NSColor
|
|
|
1925
|
+ let inputBackground: NSColor
|
|
|
1926
|
+ let inputBorder: NSColor
|
|
|
1927
|
+ let primaryBlue: NSColor
|
|
|
1928
|
+ let primaryBlueBorder: NSColor
|
|
|
1929
|
+ let cancelButton: NSColor
|
|
|
1930
|
+ let meetingBadge: NSColor
|
|
|
1931
|
+ let separator: NSColor
|
|
|
1932
|
+ let textPrimary: NSColor
|
|
|
1933
|
+ let textSecondary: NSColor
|
|
|
1934
|
+ let textTertiary: NSColor
|
|
|
1935
|
+ let textMuted: NSColor
|
|
|
1936
|
+
|
|
|
1937
|
+ init(isDarkMode: Bool) {
|
|
|
1938
|
+ if isDarkMode {
|
|
|
1939
|
+ pageBackground = NSColor(calibratedRed: 10.0 / 255.0, green: 11.0 / 255.0, blue: 12.0 / 255.0, alpha: 1)
|
|
|
1940
|
+ sidebarBackground = NSColor(calibratedRed: 16.0 / 255.0, green: 17.0 / 255.0, blue: 19.0 / 255.0, alpha: 1)
|
|
|
1941
|
+ sectionCard = NSColor(calibratedRed: 22.0 / 255.0, green: 23.0 / 255.0, blue: 26.0 / 255.0, alpha: 1)
|
|
|
1942
|
+ tabBarBackground = NSColor(calibratedRed: 22.0 / 255.0, green: 23.0 / 255.0, blue: 26.0 / 255.0, alpha: 1)
|
|
|
1943
|
+ tabIdleBackground = NSColor(calibratedRed: 22.0 / 255.0, green: 23.0 / 255.0, blue: 26.0 / 255.0, alpha: 1)
|
|
|
1944
|
+ inputBackground = NSColor(calibratedRed: 20.0 / 255.0, green: 21.0 / 255.0, blue: 24.0 / 255.0, alpha: 1)
|
|
|
1945
|
+ inputBorder = NSColor(calibratedRed: 38.0 / 255.0, green: 40.0 / 255.0, blue: 44.0 / 255.0, alpha: 1)
|
|
|
1946
|
+ primaryBlue = NSColor(calibratedRed: 27.0 / 255.0, green: 115.0 / 255.0, blue: 232.0 / 255.0, alpha: 1)
|
|
|
1947
|
+ primaryBlueBorder = NSColor(calibratedRed: 42.0 / 255.0, green: 118.0 / 255.0, blue: 220.0 / 255.0, alpha: 1)
|
|
|
1948
|
+ cancelButton = NSColor(calibratedRed: 20.0 / 255.0, green: 21.0 / 255.0, blue: 24.0 / 255.0, alpha: 1)
|
|
|
1949
|
+ meetingBadge = NSColor(calibratedRed: 0.88, green: 0.66, blue: 0.14, alpha: 1)
|
|
|
1950
|
+ separator = NSColor(calibratedRed: 26.0 / 255.0, green: 27.0 / 255.0, blue: 30.0 / 255.0, alpha: 1)
|
|
|
1951
|
+ textPrimary = NSColor(calibratedWhite: 0.98, alpha: 1)
|
|
|
1952
|
+ textSecondary = NSColor(calibratedWhite: 0.78, alpha: 1)
|
|
|
1953
|
+ textTertiary = NSColor(calibratedWhite: 0.66, alpha: 1)
|
|
|
1954
|
+ textMuted = NSColor(calibratedWhite: 0.44, alpha: 1)
|
|
|
1955
|
+ } else {
|
|
|
1956
|
+ pageBackground = NSColor(calibratedRed: 244.0 / 255.0, green: 246.0 / 255.0, blue: 249.0 / 255.0, alpha: 1)
|
|
|
1957
|
+ sidebarBackground = NSColor(calibratedRed: 232.0 / 255.0, green: 236.0 / 255.0, blue: 242.0 / 255.0, alpha: 1)
|
|
|
1958
|
+ sectionCard = NSColor.white
|
|
|
1959
|
+ tabBarBackground = NSColor.white
|
|
|
1960
|
+ tabIdleBackground = NSColor.white
|
|
|
1961
|
+ inputBackground = NSColor(calibratedRed: 247.0 / 255.0, green: 249.0 / 255.0, blue: 252.0 / 255.0, alpha: 1)
|
|
|
1962
|
+ inputBorder = NSColor(calibratedRed: 211.0 / 255.0, green: 218.0 / 255.0, blue: 228.0 / 255.0, alpha: 1)
|
|
|
1963
|
+ primaryBlue = NSColor(calibratedRed: 27.0 / 255.0, green: 115.0 / 255.0, blue: 232.0 / 255.0, alpha: 1)
|
|
|
1964
|
+ primaryBlueBorder = NSColor(calibratedRed: 42.0 / 255.0, green: 118.0 / 255.0, blue: 220.0 / 255.0, alpha: 1)
|
|
|
1965
|
+ cancelButton = NSColor(calibratedRed: 240.0 / 255.0, green: 243.0 / 255.0, blue: 248.0 / 255.0, alpha: 1)
|
|
|
1966
|
+ meetingBadge = NSColor(calibratedRed: 0.88, green: 0.66, blue: 0.14, alpha: 1)
|
|
|
1967
|
+ separator = NSColor(calibratedRed: 212.0 / 255.0, green: 219.0 / 255.0, blue: 229.0 / 255.0, alpha: 1)
|
|
|
1968
|
+ textPrimary = NSColor(calibratedRed: 32.0 / 255.0, green: 38.0 / 255.0, blue: 47.0 / 255.0, alpha: 1)
|
|
|
1969
|
+ textSecondary = NSColor(calibratedRed: 82.0 / 255.0, green: 92.0 / 255.0, blue: 107.0 / 255.0, alpha: 1)
|
|
|
1970
|
+ textTertiary = NSColor(calibratedRed: 110.0 / 255.0, green: 120.0 / 255.0, blue: 136.0 / 255.0, alpha: 1)
|
|
|
1971
|
+ textMuted = NSColor(calibratedRed: 134.0 / 255.0, green: 145.0 / 255.0, blue: 162.0 / 255.0, alpha: 1)
|
|
|
1972
|
+ }
|
|
|
1973
|
+ }
|
|
1890
|
1974
|
}
|
|
1891
|
1975
|
|
|
1892
|
1976
|
private struct Typography {
|