|
@@ -120,7 +120,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
private let savedJobsDocumentView = JobListingsDocumentView()
|
|
private let savedJobsDocumentView = JobListingsDocumentView()
|
|
|
private let savedJobsStack = NSStackView()
|
|
private let savedJobsStack = NSStackView()
|
|
|
private let settingsPageContainer = NSView()
|
|
private let settingsPageContainer = NSView()
|
|
|
- private let themeControl = NSSegmentedControl()
|
|
|
|
|
private let cvMakerPageContainer = NSView()
|
|
private let cvMakerPageContainer = NSView()
|
|
|
private lazy var cvMakerPageView: CVMakerPageView = {
|
|
private lazy var cvMakerPageView: CVMakerPageView = {
|
|
|
CVMakerPageView()
|
|
CVMakerPageView()
|
|
@@ -1498,7 +1497,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
|
|
|
|
|
let settingsSection = makeSettingsSection(rows: [
|
|
let settingsSection = makeSettingsSection(rows: [
|
|
|
makeSettingsRow(title: "Share App", systemImage: "square.and.arrow.up", accessory: nil),
|
|
makeSettingsRow(title: "Share App", systemImage: "square.and.arrow.up", accessory: nil),
|
|
|
- makeSettingsRow(title: "Theme", systemImage: "circle.lefthalf.filled", accessory: makeThemeControl()),
|
|
|
|
|
makeSettingsRow(title: "More Apps", systemImage: "square.grid.2x2", accessory: nil)
|
|
makeSettingsRow(title: "More Apps", systemImage: "square.grid.2x2", accessory: nil)
|
|
|
])
|
|
])
|
|
|
|
|
|
|
@@ -1534,35 +1532,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
])
|
|
])
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private func makeThemeControl() -> NSSegmentedControl {
|
|
|
|
|
- themeControl.segmentCount = 3
|
|
|
|
|
- themeControl.trackingMode = .selectOne
|
|
|
|
|
- themeControl.setLabel("System", forSegment: 0)
|
|
|
|
|
- themeControl.setLabel("Light", forSegment: 1)
|
|
|
|
|
- themeControl.setLabel("Dark", forSegment: 2)
|
|
|
|
|
- themeControl.target = self
|
|
|
|
|
- themeControl.action = #selector(didChangeThemeSelection(_:))
|
|
|
|
|
- switch NSApp.appearance?.bestMatch(from: [.darkAqua, .aqua]) {
|
|
|
|
|
- case .darkAqua:
|
|
|
|
|
- themeControl.selectedSegment = 2
|
|
|
|
|
- case .aqua:
|
|
|
|
|
- themeControl.selectedSegment = 1
|
|
|
|
|
- default:
|
|
|
|
|
- themeControl.selectedSegment = 0
|
|
|
|
|
- }
|
|
|
|
|
- themeControl.segmentStyle = .rounded
|
|
|
|
|
- themeControl.segmentDistribution = .fillEqually
|
|
|
|
|
- themeControl.setWidth(68, forSegment: 0)
|
|
|
|
|
- themeControl.setWidth(68, forSegment: 1)
|
|
|
|
|
- themeControl.setWidth(68, forSegment: 2)
|
|
|
|
|
- themeControl.controlSize = .large
|
|
|
|
|
- themeControl.font = .systemFont(ofSize: 13, weight: .semibold)
|
|
|
|
|
- themeControl.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
- themeControl.widthAnchor.constraint(equalToConstant: 204).isActive = true
|
|
|
|
|
- themeControl.heightAnchor.constraint(equalToConstant: 30).isActive = true
|
|
|
|
|
- return themeControl
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private func makeSettingsSection(rows: [NSView]) -> NSView {
|
|
private func makeSettingsSection(rows: [NSView]) -> NSView {
|
|
|
let section = NSStackView()
|
|
let section = NSStackView()
|
|
|
section.orientation = .vertical
|
|
section.orientation = .vertical
|
|
@@ -2509,17 +2478,6 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @objc private func didChangeThemeSelection(_ sender: NSSegmentedControl) {
|
|
|
|
|
- switch sender.selectedSegment {
|
|
|
|
|
- case 1:
|
|
|
|
|
- NSApp.appearance = NSAppearance(named: .aqua)
|
|
|
|
|
- case 2:
|
|
|
|
|
- NSApp.appearance = NSAppearance(named: .darkAqua)
|
|
|
|
|
- default:
|
|
|
|
|
- NSApp.appearance = nil
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private func selectSidebarItem(at index: Int) {
|
|
private func selectSidebarItem(at index: Int) {
|
|
|
dismissIndeedJobBrowserEmbedded()
|
|
dismissIndeedJobBrowserEmbedded()
|
|
|
guard index >= 0, index < currentSidebarItems.count else { return }
|
|
guard index >= 0, index < currentSidebarItems.count else { return }
|