Repository navigation
Conversation
| using namespace Hyprtoolkit; | ||
|
|
||
| static Vector2D childSizeForConstraint(const SP<IElement>& child, const Vector2D& constraint, const Vector2D& textConstraint) { | ||
| const auto CHILD_CONSTRAINT = dynamicPointerCast<CTextElement>(child) ? textConstraint : constraint; |
There was a problem hiding this comment.
I don't think having a specific work around for one type of element is a good idea. Putting text inside a rectangle for a background or a border would break this.
| for (const auto& child : impl->children) { | ||
| max.x = std::max(childSize(child).x, max.x); | ||
| max.y += childSize(child).y + m_impl->data.gap; | ||
| const auto CHILD_SIZE = childSizeForConstraint(child, parent, TEXT_CONSTRAINT); |
There was a problem hiding this comment.
This should respect calc if it is defined, not just pass in parent.
| for (const auto& child : impl->children) { | ||
| max.x = std::max(childSize(child).x, max.x); | ||
| max.y += childSize(child).y + m_impl->data.gap; | ||
| const auto CHILD_SIZE = childSizeForConstraint(child, parent, TEXT_CONSTRAINT); |
There was a problem hiding this comment.
Passing the parent means that percent children will grow to the full size of the parent, not the container (hence the fix in the spinbox). I think this behavior is helpful and should be kept.
+-------------------------+
| button | two | button |
| | lines | |
+-------------------------+
The center element is multi line text or some larger height element. And there are two buttons beside it (like a spinbox). There is no way for the side buttons to grow to be the same height as the center element without being able to set their height percent.
|
Heads up for whenever this merges: #158 fixes the link-region offset bug (#127) in this same file. It only changes how |


adds some tests (codex) and fixes a bunch of repositioning issues with text, flip-flops, ellipsizing relayouting, etc. Codex-assisted.