settings: match the add-device menu to the sidebar on macOS 26

On macOS 26 and later, the borderless button menu style draws the
Devices "New…" entry as a compact pull-down: smaller text, an untinted
icon, a chevron, and a text column that does not line up with the other
sidebar rows. Only the button menu style combined with the plain button
style renders the label like the neighbouring rows, so use that on
macOS 26 and keep the existing style on older releases and on iOS.

Assisted-by: Claude:claude-fable-5-1
This commit is contained in:
osy
2026-09-23 01:05:58 -05:00
parent 100701eb8b
commit 2e0bfc8bbe
2 changed files with 19 additions and 2 deletions
@@ -85,7 +85,24 @@ struct VMSettingsAddDeviceMenuView: View {
} label: {
Label("New…", systemImage: "plus")
}.help("Add a new device.")
.menuStyle(.borderlessButton)
.addDeviceMenuStyle()
}
}
extension View {
/// Style the "New…" menu so it matches the other entries in the settings sidebar.
@ViewBuilder
func addDeviceMenuStyle() -> some View {
#if os(macOS)
if #available(macOS 26, *) {
// .borderlessButton renders as a compact pull-down that no longer matches the sidebar rows
self.menuStyle(.button).buttonStyle(.plain)
} else {
self.menuStyle(.borderlessButton)
}
#else
self.menuStyle(.borderlessButton)
#endif
}
}
@@ -52,7 +52,7 @@ struct VMAppleSettingsAddDeviceMenuView: View {
} label: {
Label("New…", systemImage: "plus")
}.help("Add a new device.")
.menuStyle(.borderlessButton)
.addDeviceMenuStyle()
}
}