|
|
@@ -120,7 +120,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
120
|
120
|
private let savedJobsDocumentView = JobListingsDocumentView()
|
|
121
|
121
|
private let savedJobsStack = NSStackView()
|
|
122
|
122
|
private let settingsPageContainer = NSView()
|
|
123
|
|
- private let themeControl = NSSegmentedControl()
|
|
124
|
123
|
private let cvMakerPageContainer = NSView()
|
|
125
|
124
|
private lazy var cvMakerPageView: CVMakerPageView = {
|
|
126
|
125
|
CVMakerPageView()
|
|
|
@@ -1498,7 +1497,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
1498
|
1497
|
|
|
1499
|
1498
|
let settingsSection = makeSettingsSection(rows: [
|
|
1500
|
1499
|
makeSettingsRow(title: "Share App", systemImage: "square.and.arrow.up", accessory: nil),
|
|
1501
|
|
- makeSettingsRow(title: "Theme", systemImage: "circle.lefthalf.filled", accessory: makeThemeControl()),
|
|
1502
|
1500
|
makeSettingsRow(title: "More Apps", systemImage: "square.grid.2x2", accessory: nil)
|
|
1503
|
1501
|
])
|
|
1504
|
1502
|
|
|
|
@@ -1534,35 +1532,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
1534
|
1532
|
])
|
|
1535
|
1533
|
}
|
|
1536
|
1534
|
|
|
1537
|
|
- private func makeThemeControl() -> NSSegmentedControl {
|
|
1538
|
|
- themeControl.segmentCount = 3
|
|
1539
|
|
- themeControl.trackingMode = .selectOne
|
|
1540
|
|
- themeControl.setLabel("System", forSegment: 0)
|
|
1541
|
|
- themeControl.setLabel("Light", forSegment: 1)
|
|
1542
|
|
- themeControl.setLabel("Dark", forSegment: 2)
|
|
1543
|
|
- themeControl.target = self
|
|
1544
|
|
- themeControl.action = #selector(didChangeThemeSelection(_:))
|
|
1545
|
|
- switch NSApp.appearance?.bestMatch(from: [.darkAqua, .aqua]) {
|
|
1546
|
|
- case .darkAqua:
|
|
1547
|
|
- themeControl.selectedSegment = 2
|
|
1548
|
|
- case .aqua:
|
|
1549
|
|
- themeControl.selectedSegment = 1
|
|
1550
|
|
- default:
|
|
1551
|
|
- themeControl.selectedSegment = 0
|
|
1552
|
|
- }
|
|
1553
|
|
- themeControl.segmentStyle = .rounded
|
|
1554
|
|
- themeControl.segmentDistribution = .fillEqually
|
|
1555
|
|
- themeControl.setWidth(68, forSegment: 0)
|
|
1556
|
|
- themeControl.setWidth(68, forSegment: 1)
|
|
1557
|
|
- themeControl.setWidth(68, forSegment: 2)
|
|
1558
|
|
- themeControl.controlSize = .large
|
|
1559
|
|
- themeControl.font = .systemFont(ofSize: 13, weight: .semibold)
|
|
1560
|
|
- themeControl.translatesAutoresizingMaskIntoConstraints = false
|
|
1561
|
|
- themeControl.widthAnchor.constraint(equalToConstant: 204).isActive = true
|
|
1562
|
|
- themeControl.heightAnchor.constraint(equalToConstant: 30).isActive = true
|
|
1563
|
|
- return themeControl
|
|
1564
|
|
- }
|
|
1565
|
|
-
|
|
1566
|
1535
|
private func makeSettingsSection(rows: [NSView]) -> NSView {
|
|
1567
|
1536
|
let section = NSStackView()
|
|
1568
|
1537
|
section.orientation = .vertical
|
|
|
@@ -2509,17 +2478,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
2509
|
2478
|
}
|
|
2510
|
2479
|
}
|
|
2511
|
2480
|
|
|
2512
|
|
- @objc private func didChangeThemeSelection(_ sender: NSSegmentedControl) {
|
|
2513
|
|
- switch sender.selectedSegment {
|
|
2514
|
|
- case 1:
|
|
2515
|
|
- NSApp.appearance = NSAppearance(named: .aqua)
|
|
2516
|
|
- case 2:
|
|
2517
|
|
- NSApp.appearance = NSAppearance(named: .darkAqua)
|
|
2518
|
|
- default:
|
|
2519
|
|
- NSApp.appearance = nil
|
|
2520
|
|
- }
|
|
2521
|
|
- }
|
|
2522
|
|
-
|
|
2523
|
2481
|
private func selectSidebarItem(at index: Int) {
|
|
2524
|
2482
|
dismissIndeedJobBrowserEmbedded()
|
|
2525
|
2483
|
guard index >= 0, index < currentSidebarItems.count else { return }
|