Skip to content

A bunch of layout fixes - #123

Merged
vaxerski merged 6 commits into
hyprwm:mainfrom
BlueZeeKing:layout-fix
Sep 16, 2026
Merged

vaxerski merged 6 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 5 times, most recently from 10caef1 to cd43366 Compare August 30, 2026 04:58
@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

@BlueZeeKing

Copy link
Copy Markdown
Contributor Author

@vaxerski this PR is ready except for deciding what to do about percent children in elements. (See above message)

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.
@vaxerski

Copy link
Copy Markdown
Member

should be configurable for the slider. Maybe hide it by default.

As for percent, you can break old layouts as long as it doesnt make shit completely explode

@BlueZeeKing
BlueZeeKing force-pushed the layout-fix branch 2 times, most recently from 1150acd to 90497ce Compare September 13, 2026 16:19
@BlueZeeKing
BlueZeeKing marked this pull request as ready for review September 13, 2026 16:21
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

Copy link
Copy Markdown
Contributor Author

I tested hyprpaper, hyprlauncher, hyprsysteminfo, hyprshutdown, hyprpwcenter, hyprland-guiutils, hyprpolkitagent, and the hyprland overview and only hyprpwcenter and hyprshutdown had minor layout issues, but both were still usable. I made draft prs for both

@vaxerski
vaxerski merged commit b3f2d0e into hyprwm:main Sep 16, 2026
2 checks passed
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