From 3a5a7ee6239926387bfc4bb1f6405b0227ef5e1e Mon Sep 17 00:00:00 2001 From: maxsoch Date: Mon, 6 Jul 2026 22:18:23 +0200 Subject: [PATCH] explain the greedy setting in the settings window Add a note under the greedy checkbox spelling out what self-updating casks are and that the setting affects both the outdated listing and upgrades (Upgrade All and auto-upgrade). The indented-gray-note layout is extracted into a noteRow helper, now shared with the cask warning. Co-Authored-By: Claude Fable 5 --- BrewBar/SettingsWindowController.swift | 34 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/BrewBar/SettingsWindowController.swift b/BrewBar/SettingsWindowController.swift index eb216d8..5ab7ddc 100644 --- a/BrewBar/SettingsWindowController.swift +++ b/BrewBar/SettingsWindowController.swift @@ -87,6 +87,10 @@ class SettingsWindowController: NSWindowController { action: #selector(toggleGreedy(_:)) ) + let greedyNote = noteRow( + "Some apps (Chrome, Firefox…) update themselves, so Homebrew normally ignores them. When enabled, BrewBar also lists them as outdated and includes them in Upgrade All and auto-upgrades." + ) + autoUpgradeFormulaeCheckbox = NSButton( checkboxWithTitle: "Automatically upgrade formulae (command-line tools)", target: self, @@ -99,18 +103,9 @@ class SettingsWindowController: NSWindowController { action: #selector(toggleAutoUpgradeCasks(_:)) ) - let caskWarning = NSTextField( - wrappingLabelWithString: "⚠️ Upgrading a cask can close and replace the app while it is running (e.g. your browser), without warning." + let caskWarningRow = noteRow( + "⚠️ Upgrading a cask can close and replace the app while it is running (e.g. your browser), without warning." ) - caskWarning.font = .systemFont(ofSize: NSFont.smallSystemFontSize) - caskWarning.textColor = .secondaryLabelColor - caskWarning.preferredMaxLayoutWidth = 320 - - // indent the note so it reads as belonging to the checkbox above - let spacer = NSView() - spacer.widthAnchor.constraint(equalToConstant: 18).isActive = true - let caskWarningRow = NSStackView(views: [spacer, caskWarning]) - caskWarningRow.orientation = .horizontal notifyCheckbox = NSButton( checkboxWithTitle: "Notify when new updates are found", @@ -134,6 +129,7 @@ class SettingsWindowController: NSWindowController { frequencyRow, customRow, greedyCheckbox, + greedyNote, separator(), autoUpgradeFormulaeCheckbox, autoUpgradeCasksCheckbox, @@ -191,6 +187,22 @@ class SettingsWindowController: NSWindowController { return box } + /// Small gray explanatory text, indented to read as belonging to the + /// checkbox above it. + func noteRow(_ text: String) -> NSStackView { + let label = NSTextField(wrappingLabelWithString: text) + label.font = .systemFont(ofSize: NSFont.smallSystemFontSize) + label.textColor = .secondaryLabelColor + label.preferredMaxLayoutWidth = 320 + + let spacer = NSView() + spacer.widthAnchor.constraint(equalToConstant: 18).isActive = true + + let row = NSStackView(views: [spacer, label]) + row.orientation = .horizontal + return row + } + // MARK: - Actions @objc func presetPicked(_ sender: NSPopUpButton) {