|
@@ -1118,9 +1118,9 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
aboutTitle.alignment = .left
|
|
aboutTitle.alignment = .left
|
|
|
|
|
|
|
|
let aboutSection = makeSettingsSection(rows: [
|
|
let aboutSection = makeSettingsSection(rows: [
|
|
|
- makeSettingsRow(title: "Support", systemImage: "questionmark.circle", accessory: nil),
|
|
|
|
|
- makeSettingsRow(title: "Terms of Use", systemImage: "doc.text", accessory: nil),
|
|
|
|
|
- makeSettingsRow(title: "Privacy Policy", systemImage: "shield", accessory: nil)
|
|
|
|
|
|
|
+ makeSettingsRow(title: "Support", systemImage: "questionmark.circle", accessory: nil, tapAction: #selector(didTapSupport)),
|
|
|
|
|
+ makeSettingsRow(title: "Terms of Use", systemImage: "doc.text", accessory: nil, tapAction: #selector(didTapTermsOfUse)),
|
|
|
|
|
+ makeSettingsRow(title: "Privacy Policy", systemImage: "shield", accessory: nil, tapAction: #selector(didTapPrivacyPolicy))
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
let aboutStack = NSStackView(views: [aboutTitle, aboutSection])
|
|
let aboutStack = NSStackView(views: [aboutTitle, aboutSection])
|
|
@@ -1207,7 +1207,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
return section
|
|
return section
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private func makeSettingsRow(title: String, systemImage: String, accessory: NSView?) -> NSView {
|
|
|
|
|
|
|
+ private func makeSettingsRow(title: String, systemImage: String, accessory: NSView?, tapAction: Selector? = nil) -> NSView {
|
|
|
let row = NSView()
|
|
let row = NSView()
|
|
|
row.translatesAutoresizingMaskIntoConstraints = false
|
|
row.translatesAutoresizingMaskIntoConstraints = false
|
|
|
row.wantsLayer = true
|
|
row.wantsLayer = true
|
|
@@ -1262,6 +1262,24 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
rowStack.bottomAnchor.constraint(equalTo: row.bottomAnchor)
|
|
rowStack.bottomAnchor.constraint(equalTo: row.bottomAnchor)
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
|
|
+ if let tapAction {
|
|
|
|
|
+ let rowButton = NSButton(title: "", target: self, action: tapAction)
|
|
|
|
|
+ rowButton.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
+ rowButton.isBordered = false
|
|
|
|
|
+ rowButton.bezelStyle = .regularSquare
|
|
|
|
|
+ rowButton.setButtonType(.momentaryChange)
|
|
|
|
|
+ rowButton.focusRingType = .none
|
|
|
|
|
+ rowButton.wantsLayer = true
|
|
|
|
|
+ rowButton.layer?.backgroundColor = .clear
|
|
|
|
|
+ row.addSubview(rowButton)
|
|
|
|
|
+ NSLayoutConstraint.activate([
|
|
|
|
|
+ rowButton.leadingAnchor.constraint(equalTo: row.leadingAnchor),
|
|
|
|
|
+ rowButton.trailingAnchor.constraint(equalTo: row.trailingAnchor),
|
|
|
|
|
+ rowButton.topAnchor.constraint(equalTo: row.topAnchor),
|
|
|
|
|
+ rowButton.bottomAnchor.constraint(equalTo: row.bottomAnchor)
|
|
|
|
|
+ ])
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return row
|
|
return row
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1368,6 +1386,31 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
|
focusSearchField(seed: "Find jobs that require skill: ")
|
|
focusSearchField(seed: "Find jobs that require skill: ")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @objc private func didTapSupport() {
|
|
|
|
|
+ presentSettingsPlaceholderAlert(for: "Support")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @objc private func didTapTermsOfUse() {
|
|
|
|
|
+ presentSettingsPlaceholderAlert(for: "Terms of Use")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @objc private func didTapPrivacyPolicy() {
|
|
|
|
|
+ presentSettingsPlaceholderAlert(for: "Privacy Policy")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private func presentSettingsPlaceholderAlert(for featureName: String) {
|
|
|
|
|
+ let alert = NSAlert()
|
|
|
|
|
+ alert.messageText = "\(featureName) coming soon"
|
|
|
|
|
+ alert.informativeText = "This section is a placeholder for now."
|
|
|
|
|
+ alert.alertStyle = .informational
|
|
|
|
|
+ alert.addButton(withTitle: "OK")
|
|
|
|
|
+ if let window {
|
|
|
|
|
+ alert.beginSheetModal(for: window)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ alert.runModal()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private func focusSearchField(seed: String) {
|
|
private func focusSearchField(seed: String) {
|
|
|
jobKeywordsField.stringValue = seed
|
|
jobKeywordsField.stringValue = seed
|
|
|
window?.makeFirstResponder(jobKeywordsField)
|
|
window?.makeFirstResponder(jobKeywordsField)
|