Skip to content

Modernize the settings window UI #47

Description

@hisaac

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions