Skip to content

Box Layout: consider spacing and padding when using percentage values for width and height #10993

Open
Murmele wants to merge 5 commits intoslint-ui:masterfrom
Murmele:mm/horizontal_box_padding
Open

Box Layout: consider spacing and padding when using percentage values for width and height #10993
Murmele wants to merge 5 commits intoslint-ui:masterfrom
Murmele:mm/horizontal_box_padding

Conversation

@Murmele
Copy link
Contributor

@Murmele Murmele commented Mar 11, 2026

  • If possible, the change is auto-tested

When using percentage values in the layout, the spacing and the padding are not considered. So with 50% for 2 elements one element goes outside of the layout

export component TestCase inherits Window {
    preferred-width: 300px;
    preferred-height: 300px;

    box:= HorizontalBox {
        rect:= Rectangle {
            width: 50%;
            background: red;
        }

        Rectangle {
            width: 50%;
            background: blue;
        }
    }
}

Old:
image

New:
image

@Murmele Murmele force-pushed the mm/horizontal_box_padding branch from ef3a758 to fd2d9ae Compare March 11, 2026 12:16
@Murmele Murmele marked this pull request as ready for review March 11, 2026 12:16
Fix comment

Co-authored-by: Martin Marmsoler <Murmele@users.noreply.github.com>
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.

1 participant