Skip to content

A bunch of layout fixes - #123

Draft
BlueZeeKing wants to merge 5 commits into
hyprwm:mainfrom
BlueZeeKing:layout-fix
Draft

A bunch of layout fixes#123
BlueZeeKing wants to merge 5 commits into
hyprwm:mainfrom
BlueZeeKing:layout-fix

Conversation

@BlueZeeKing

@BlueZeeKing BlueZeeKing commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This has not been tested without #122

This passes the parent sized down to children when a given element is auto sized. This allows elements with automatic sizes to grow if necessary.

This adds a specific grow flag to preferredSize which controls whether percents are calculated or not. This is necessary because when an element is auto sized we don't want children that are percent sized to grow to fill the entire parent.

@vaxerski

Copy link
Copy Markdown
Member

is this ready or a draft

@BlueZeeKing

Copy link
Copy Markdown
Contributor Author

is this ready or a draft

There's still a couple more things I want to fix up and review, but should be ready by the end of the week

@BlueZeeKing
BlueZeeKing force-pushed the layout-fix branch 3 times, most recently from ccbb324 to 223a339 Compare August 30, 2026 04:37
Previously the child got it's preferred size even if it was bigger than
the parent. This should not happen, but it is possible with row or
column layouts. This could be fixed in every case where an element
misbehaves, but it is easiest to fix here.
This reports the parent size to the child of a layout, instead of
directly reporting the layouts size. This is only reported if the size
of the layout is automatic. This allows the layout to grow to the full
size of the parent instead of staying in place. In order to prevent
percent based elements from growing to the full size of the parent,
a grow flag is added that stops percentage based sizes from applying.
@BlueZeeKing

BlueZeeKing commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Currently, percent children in row and column layouts don't cause the layout to expand to fill the entire parent. However, for normal elements percent children can cause the element to grow to fill the parent. The way the row and col layouts did it was a bit hacky, so this PR adds a grow flag to make this behavior explicit. I think behavior for normal elements and children should follow row and column layouts. This makes things like buttons easier because there doesn't need to be a specific hack to only use the labels preferred size, the generic preferred size function would work. It also means that percent is always applied to the current parent, not anything above that. This does break layouts that relied on the previous layout. Do you have a preference on keeping the old behavior or following what rows and cols do?

Also, sliders have a label that shows the current value next to it. This label has been hidden because the slider fills the whole parent, and this has been true since at least v0.5.4. Making this label display correctly does make hyprpwcenter look a little strange though.

image

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.

2 participants