Repository navigation
[patch] Measure a titled BorderElement wide enough to draw its title - #194
Merged
Merged
Conversation
…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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #157
What changed
BorderElement.OnCalculateRequiredDimensionsForChildrennow returns a content width of at leasttitle length + 2when a title is set andBorderStyleis notNone. Once the base class adds the border padding, the outer width is at leasttitle length + 4, which is the widthOnRenderneeds to drawtitlein full. Truncation inOnRenderis still the fallback when the parent cannot give that much room.GetSingleLineTitle()so the measure pass and the render pass use the same title length.Tests
TitleLongerThanTheContentIsDrawnInFullInsideAStackPanelreproduces the issue's horizontalStackPanelcase. BothSingleandStatusare now drawn.MeasuredWidthMakesRoomForTheTitleOnlyWhenOneIsDrawnchecks that untitled andBorderStyle.Noneborders are still exactly as wide as their content.🤖 Generated with Claude Code
https://claude.ai/code/session_015YFg3aG1od37a8RytUTWQy
Generated by Claude Code