Skip to content

Plugin markup tabs can show an icon - #213

Merged
eriknihlen merged 2 commits into
eriknihlen:mainfrom
davidc-smith:feat/tab-icons-upstream
Oct 8, 2026
Merged

eriknihlen merged 2 commits into
eriknihlen:mainfrom
davidc-smith:feat/tab-icons-upstream

Conversation

@davidc-smith

Copy link
Copy Markdown
Contributor

Plugin markup <tab> can now show an icon, using the same attributes as <button>:

<tab x="140" y="4" w="90" h="24" text="Spells" icon="{SpellId}" iconkind="spell"
     selected="{SpellsTab}" onclick="{ShowSpells}"/>
  • icon is a literal or a binding; iconkind is did (default), spell or item, exactly as on buttons.
  • The icon sits in a square column at the left and the caption centers in the rest. Leaving out text gives an icon-only tab.
  • An unselected tab draws its icon at reduced alpha, so it recedes along with its muted caption. Buttons still draw their icons as authored.

UiMarkupTabButton already inherits UiSimpleButton's icon drawing, so most of the change is in the parser. Buttons and tabs now read icon/iconkind through one shared helper, and UiSimpleButton gains an overridable IconTint that the tab uses for the dimming.

Tests: MarkupIconTests covers tab icon dispatch, bound re-reads, the no-icon case, build-time errors for a bad iconkind or binding, and the selected/unselected icon alpha. docs/plugin-ui-markup.md lists the new attributes.

Note: on current main, a clean restore fails NuGet audit on the October SixLabors.ImageSharp advisories (NU1902/NU1903 as errors). I built and tested this branch with -p:NuGetAudit=false. The App test failures with that flag are the same with and without this change (installed-DAT lanes only).

https://claude.ai/code/session_01SY57mHJLZ6djpWZ5nP37Tw

<tab> takes the same icon and iconkind attributes as <button>. The tab
already draws an icon through UiSimpleButton, so the parser now reads the
pair through one shared helper for both controls.

Claude-Session: https://claude.ai/code/session_01SY57mHJLZ6djpWZ5nP37Tw
A tab's caption already mutes when the tab is not selected; its icon now
recedes with it. UiSimpleButton draws its icon through an IconTint the tab
overrides, so buttons keep drawing their icons as authored.

Claude-Session: https://claude.ai/code/session_01SY57mHJLZ6djpWZ5nP37Tw
@eriknihlen
eriknihlen merged commit e8c7670 into eriknihlen:main Oct 8, 2026
3 of 7 checks passed
@davidc-smith
davidc-smith deleted the feat/tab-icons-upstream branch October 10, 2026 21:38
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.

2 participants