Add setting to hide the startup picker with a one-time menu-bar hint
Lets someone skip the startup picker entirely; the first time it would've shown with nothing running, a small popover on the menu bar icon points there instead, then never again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2 files changed
+81
-4
No files matched your search
@@ -508,6 +508,8 @@ private final class SettingsViewController: NSViewController {
|
||||
private let autoUpdateCheckbox = NSButton(
|
||||
checkboxWithTitle: "Automatically check for updates", target: nil, action: nil)
|
||||
private let launchAtLoginCheckbox = NSButton(checkboxWithTitle: "Launch at Login", target: nil, action: nil)
|
||||
private let hideStartupPickerCheckbox = NSButton(
|
||||
checkboxWithTitle: "Hide the startup picker when no profiles are running", target: nil, action: nil)
|
||||
private let checkNowButton = NSButton(title: "Check for Updates\u{2026}", target: nil, action: nil)
|
||||
private let tagStyleLabel = NSTextField(labelWithString: "Window tag:")
|
||||
private let tagStylePopUp = NSPopUpButton(frame: .zero, pullsDown: false)
|
||||
@@ -564,12 +566,17 @@ private final class SettingsViewController: NSViewController {
|
||||
autoUpdateCheckbox.action = #selector(toggleAutoUpdate)
|
||||
autoUpdateCheckbox.state = UpdateChecker.automaticCheckEnabled ? .on : .off
|
||||
|
||||
hideStartupPickerCheckbox.target = self
|
||||
hideStartupPickerCheckbox.action = #selector(toggleHideStartupPicker)
|
||||
hideStartupPickerCheckbox.state = StartupBehavior.hidePicker ? .on : .off
|
||||
|
||||
checkNowButton.target = self
|
||||
checkNowButton.action = #selector(checkNow)
|
||||
checkNowButton.bezelStyle = .rounded
|
||||
|
||||
stack = NSStackView(views: [
|
||||
launchAtLoginCheckbox, clickActionRow, tagStyleRow, autoUpdateCheckbox, checkNowButton,
|
||||
launchAtLoginCheckbox, clickActionRow, tagStyleRow, hideStartupPickerCheckbox,
|
||||
autoUpdateCheckbox, checkNowButton,
|
||||
])
|
||||
stack.orientation = .vertical
|
||||
stack.alignment = .leading
|
||||
@@ -610,7 +617,7 @@ private final class SettingsViewController: NSViewController {
|
||||
clickActionLabel.intrinsicContentSize.width
|
||||
+ clickActionPopUp.intrinsicContentSize.width + clickActionRow.spacing,
|
||||
]
|
||||
let widest = ([launchAtLoginCheckbox, autoUpdateCheckbox, checkNowButton]
|
||||
let widest = ([launchAtLoginCheckbox, hideStartupPickerCheckbox, autoUpdateCheckbox, checkNowButton]
|
||||
.map(\.intrinsicContentSize.width) + rowWidths)
|
||||
.max() ?? 0
|
||||
preferredContentSize = NSSize(width: widest + 40, height: stack.fittingSize.height)
|
||||
@@ -648,6 +655,10 @@ private final class SettingsViewController: NSViewController {
|
||||
UpdateChecker.automaticCheckEnabled = autoUpdateCheckbox.state == .on
|
||||
}
|
||||
|
||||
@objc private func toggleHideStartupPicker() {
|
||||
StartupBehavior.hidePicker = hideStartupPickerCheckbox.state == .on
|
||||
}
|
||||
|
||||
@objc private func checkNow() {
|
||||
UpdateChecker.checkManually { result in
|
||||
DispatchQueue.main.async {
|
||||
|
||||
Reference in new issue
Block a user