Skip to content

[patch] Measure a titled BorderElement wide enough to draw its title - #194

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/157-border-title-width
Oct 6, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/157-border-title-width

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #157

What changed

Tests

  • TitleLongerThanTheContentIsDrawnInFullInsideAStackPanel reproduces the issue's horizontal StackPanel case. Both Single and Status are now drawn.
  • MeasuredWidthMakesRoomForTheTitleOnlyWhenOneIsDrawn checks that untitled and BorderStyle.None borders are still exactly as wide as their content.
  • With the fix reverted, both new tests fail. With it applied, the full suite passes (249/249) and the solution builds without warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_015YFg3aG1od37a8RytUTWQy


Generated by Claude Code

…tch]

The measure returned only the child's size, so a border sized by a layout
was exactly as wide as its content and a longer title was cut short or not
drawn at all. Reserve Title.Length + 2 columns in the content area when a
title and a border are drawn; truncation in OnRender stays the fallback.

Fixes #157

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YFg3aG1od37a8RytUTWQy
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 2d06224 into main Oct 6, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/157-border-title-width branch October 6, 2026 06:50
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.

BorderElement title is truncated or not drawn at all because the border's measured width ignores the title

2 participants