Fix for layout issue with Textual 0.54 #78
Merged
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.
By the looks of things, with #77, the issue is that there is a Vertical that is width auto, which contains a Tree that is width auto, and a Label that is width 100%. The intention seems to be that the sidebar should be as wide as the tree is, and the tree should be as wide as its content needs; meanwhile the label should be the full width of its container.
At some point recently it seems the balance in this setup has changed and the 100% label is making its auto-width container extra greedy.
Given that there's no simple way of saying "be 100% of my parent but don't put pressure on its width calculation if it's width auto"1 this PR changes things so that the label itself is also width auto, and tries to ensure that the background looks like it did before.
The fundamental fix for this probably needs to be in Textual's layout code, but this will fix Trogon itself in the meanwhile.
Fixes #77.
Footnotes
This smells like a similar class of problem to that which we ran into with
Dialog
. ↩