Skip to content

Conditional Image in FlexboxLayout causes overflow #13275

Closed

Description

@NigelBreslaw

Bug Description

The code below stops Slint working with a conditional image in a FlexboxLayout. If you change preferred-width: 24px; to width: 24px; it works.

Reproducible Code (if applicable)

export component Demo inherits Window {
    width: 100px; height: 100px;
    background: red;
    FlexboxLayout {
        if true: Rectangle {
            width: 40px;
            FlexboxLayout {
                flex-direction: column;
                padding: 8px;
                Image {
                    height: 24px;
                    preferred-width: 24px;
                    source: @image-url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAAoCAYAAABgi917AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAyhJREFUeAHtWY114jAMFvc6ACN4hHSCphMcnaB0AugEcBNAJyCd4OgEcBNcNyA3AWygk4gDjmLnD3hN39P3nhpsf1aEIskiBVAoFAqFQqFQKBQKRRED/oOIMV1WNdwDSUryQbIeDAYHUJTgOnTTYl9K8kpOXcMVQXYM6TJ170P3SDy8EV0iZyohXgp9ATsUuyGGK4L0GaF/E+Alt7TjEtwF5jmdn5yxIYlJfpIMnfkZyRYUJwQdSim0FXOJpzRwZA+/Uz29tb13bcjsZDJITnPEHg2ktQUUaxvX2U+XTBw+/Iwz9WJ1LKAY/YzISfs3kgerPxK8BfHYBg6EJ3G/mC7PJKNcv+WyXe+BGj22e3w2RnC2c8trpfrtqaE78ICfrqeODp31TV1tY92CY7BZDR979GOV3TSeYT0WHhvnklOxf09yesA/oB0mYpz0Nd3pS7Kt8wbUqc+pklOxlkdu4eaxx+tzR1ZYjo4diRF6JCeWd0dPhDprVznlrZ6d4CzRZhNm0b4P6cByhO7tnqEVuY7oZGqXtmmHwpk9c+hYrK88OuYhjmdt2uB7HNO+bcrnMCQr9Di1J3gW43cPZynGIwjDV9ZSMT5GaNM+NN/AfWdegGOS3yT30D/IbuFTErj2U0CkcO44jul86ZnQpg9lrDE7SY0dc1sTB7hfiYJDWzjp1AJ2RZeU/xDjEfQc6B4YN0YXh36HX0WpGEcBnnE+H67xgqWLQ2XBT53P/8TapZHRdL/k/RHjWG7A7NeQi1Kd7YKgQzFrpVwZ2TbGCOrW+SyjdyJ0zjz7q2AadhIPYpyI8QSzV365HQayA9aFrxPoBuz++m7VQM/e9mz7gA4jdPh4vH/qcKYBzs7hLD2cv1juH4/zwgbZh449PtsITszzXftQxprk1Z2wp/1W8DgdDZzTMoVqvHnmDBTTOoFyNhhwop9s4Qcgoy6CcoakUG4RO6ONQ/N/gSQkj/xWJ9COsHG+9OEa9Qjl+iaxhJr0s/d9gZqHQ7xxBY91/CK5v+bb/gHcCJi1KvnpmrY1uul+zH7y5f1jGuo5bWkxdfoUCoVCoVAoFAqFAv4DLOXjYixJ3ikAAAAASUVORK5CYII=");
                }
            }
        }
    }
}

Environment Details

  • Slint Version: 1.18 master
  • Platform/OS: WASM
  • Programming Language: Slint
  • Backend/Renderer:

Product Impact

No response

Activity

  1. added theissue type on Sep 7, 2026
  2. dfaure-kdab commented on Sep 7, 2026

    @dfaure-kdab
    Collaborator

    Fixed by #13199

  3. added
    a:layoutsRelated to the layouting and positioning of the elements (mO,bT)
    and removed
    need triagingIssue that the owner of the area still need to triage
    on Sep 10, 2026
  4. added 2 commits that reference this issue on Sep 14, 2026
    715a702
    2ce92bf
  5. self-assigned this
    on Sep 15, 2026
  6. added 2 commits that reference this issue on Sep 16, 2026
    4d26d6b
    2ccd558
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a:layoutsRelated to the layouting and positioning of the elements (mO,bT)

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions