Skip to content

feat(button,dialog): Button.PreferredWidth + Dialog.PlainTitle - #431

Merged
tannevaled merged 1 commit into
mainfrom
button-width-dialog-plain
Aug 30, 2026
Merged

feat(button,dialog): Button.PreferredWidth + Dialog.PlainTitle#431
tannevaled merged 1 commit into
mainfrom
button-width-dialog-plain

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Two seams a host needs to lay out buttons to fit and to give a modal a calmer card look:

  • Button.PreferredWidth() — the intrinsic width the button needs for its current content (leading icon + caption + shortcut, with paddings), so a host sizes buttons to fit instead of hard-coding a width that clips a longer or toggled label (Source vs WYSIWYG) or an added icon/shortcut.
  • Dialog.PlainTitle — draws the title bar in the panel Surface (OnSurface title + controls, a bottom hairline) instead of the accent fill, for a card-style modal. Zero value keeps the accent bar (existing dialogs unchanged).

Both pixel-tested; PlainTitle added to the Dialog MVVM allowlist. 100% coverage gate green.

Two seams a host needs to lay out buttons to fit and to give a modal a calmer
card look:

  - Button.PreferredWidth() reports the intrinsic width the button needs for its
    CURRENT content — leading icon, caption and shortcut with their paddings — so
    a host sizes a button to fit instead of hard-coding a width that clips a
    longer or toggled label (Source vs WYSIWYG) or an added icon/shortcut.
  - Dialog.PlainTitle draws the title bar in the panel Surface (OnSurface title +
    controls, a bottom hairline) instead of the accent fill, for a card-style
    modal. The zero value keeps the accent bar, so existing dialogs are unchanged.

Both are pixel-tested; PlainTitle is added to the Dialog MVVM allowlist (a
set-once appearance flag like Closable). 100% coverage gate green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit da491e0 into main Aug 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant