The settings window works but was, in the author's words, slapped together into something only
somewhat presentable. Bring it up to current macOS conventions.
What is off today
- Fixed
.frame(width: 480, height: 300) with .padding([.leading, .trailing], 40) bolted on.
Hard-coded metrics like this break under longer localised strings and larger accessibility text
sizes, and they are why the padding needed hand-tuning in the first place.
- A hand-rolled
settingDescription() applying .font(.system(size: 11.0)) and
.foregroundStyle(.secondary). Fixed point sizes do not scale; there are semantic styles for this.
LabeledContent used as a layout device, with labels like "Behavior:" attached to unrelated
controls, which is why the alignment is uneven.
- About and Quit buttons inside the settings window. Unusual on macOS, where both live in the app
menu. Note the nuance though — see below.
- The window is not resizable and does not size itself to its content.
Worth revisiting
Closed issue #4 covers the About/Quit buttons and is directly relevant: they exist because in
headless mode there is no app menu to reach them from. The suggestion there — following Moom, and
showing them only in headless mode — is a better answer than either always or never showing them, and
this is the natural time to do it.
Direction
Form with .formStyle(.grouped) gets most of the way to a standard macOS settings pane. Prefer
semantic fonts and standard spacing over fixed values, and let the window size itself.
If the xib removal lands first, this becomes a Settings scene, which also brings the standard
window behaviour and title for free.
Verify
- Looks correct at default text size and at larger accessibility sizes.
- No clipping with longer strings.
- Light and dark appearance both fine.
- Keyboard navigation reaches every control in a sensible order.
- Still usable in headless mode, where the app menu is unavailable.
The settings window works but was, in the author's words, slapped together into something only
somewhat presentable. Bring it up to current macOS conventions.
What is off today
.frame(width: 480, height: 300)with.padding([.leading, .trailing], 40)bolted on.Hard-coded metrics like this break under longer localised strings and larger accessibility text
sizes, and they are why the padding needed hand-tuning in the first place.
settingDescription()applying.font(.system(size: 11.0))and.foregroundStyle(.secondary). Fixed point sizes do not scale; there are semantic styles for this.LabeledContentused as a layout device, with labels like"Behavior:"attached to unrelatedcontrols, which is why the alignment is uneven.
menu. Note the nuance though — see below.
Worth revisiting
Closed issue #4 covers the About/Quit buttons and is directly relevant: they exist because in
headless mode there is no app menu to reach them from. The suggestion there — following Moom, and
showing them only in headless mode — is a better answer than either always or never showing them, and
this is the natural time to do it.
Direction
Formwith.formStyle(.grouped)gets most of the way to a standard macOS settings pane. Prefersemantic fonts and standard spacing over fixed values, and let the window size itself.
If the xib removal lands first, this becomes a
Settingsscene, which also brings the standardwindow behaviour and title for free.
Verify