Skip to content

Fix TabPanel: tab strip hidden by content and ignores h_alignment (#86)#87

Merged
emosaru merged 2 commits into
mainfrom
fix/issue-86-tab-zorder-alignment
May 10, 2026
Merged

Fix TabPanel: tab strip hidden by content and ignores h_alignment (#86)#87
emosaru merged 2 commits into
mainfrom
fix/issue-86-tab-zorder-alignment

Conversation

@emosaru
Copy link
Copy Markdown
Contributor

@emosaru emosaru commented May 10, 2026

Summary

Fixes two bugs in the TabControl template in LayoutControl.axaml, both reported in issue #86:

  • Tab strip covered by content — The global ClipToBounds=False style allows child content (e.g. a scroll layout) to overflow upward out of its grid row, visually hiding the tab header strip above it. Fixed by setting ZIndex="1" on the ItemsPresenter so the tab strip always renders on top of any overflowing content.

  • h_alignment ignored — The ItemsPresenter had HorizontalAlignment hardcoded to Center, so the layout's h_alignment JSON field had no effect on the tab strip. Fixed by binding HorizontalAlignment to the TabPanel data model via TrivialEnumConverter, matching how every other LayoutItem applies the same property.

Note on wrapped rows: when tabs overflow to multiple lines, WrapPanel does not support per-row alignment — each wrapped row will still align to the left. This is a WrapPanel limitation and is not addressed here.

Test plan

  • Open the test pack from the issue (ALBWR tracker) and confirm the world map scroll layout no longer covers the tab headers
  • Set h_alignment to left, center, and right on a tabbed layout and confirm the tab strip aligns accordingly on a single row
  • Confirm no visual regressions on other packs with tabbed layouts

🤖 Generated with Claude Code

…nment

Two bugs in the TabControl ControlTemplate:

1. Z-order: the global ClipToBounds=False style allows content in Grid
   Row=1 to overflow upward, visually covering the tab header strip in
   Row=0 (reproducible with a scroll layout inside a tabbed layout).
   Fix: set ZIndex=1 on the ItemsPresenter so the strip always renders
   on top of any overflowing content.

2. Alignment: the ItemsPresenter had HorizontalAlignment hardcoded to
   Center, so the tab strip ignored the layout's h_alignment setting.
   Fix: bind HorizontalAlignment to the TabPanel data model via
   TrivialEnumConverter, matching how every other LayoutItem applies it.

Closes #86

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@emosaru emosaru requested a review from a team May 10, 2026 19:25
… alignment

Introduces TabStripHorizontalAlignment (JSON: tabstrip_h_alignment, default: center)
so pack authors can independently control where the tab header strip sits within the
TabControl, while h_alignment continues to position the TabControl itself in its parent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@emosaru emosaru merged commit 9f38a26 into main May 10, 2026
3 checks passed
@emosaru emosaru deleted the fix/issue-86-tab-zorder-alignment branch May 10, 2026 20:15
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