Skip to content

Toggling item and menu bar simultaenously seems to cause window to grow #10279

@npwoods

Description

@npwoods

Bug Description

This seems to be a weird effect where toggling both a menu bar and an item in a VerticalBox can cause a window to grow, at least on Windows. This does not reproduce on SlintPad.

The following five images show the initial state, and what happens when the items ("stuff") is toggled four times.
Image
Image
Image
Image
Image

Reproducible Code (if applicable)

import {
    HorizontalBox,
    VerticalBox,
    ListView,
    LineEdit,
    Button,
} from "std-widgets.slint";

export component MainWindow inherits Window {
    property <bool> stuff-visible;

    if stuff-visible: MenuBar {
        Menu {
            title: @tr("MenuBar" => "File");
        }

        Menu {
            title: @tr("MenuBar" => "Edit");
        }
    }
    VerticalBox {
        alignment: end;

        Button {
            text: "Toggle Stuff";
            clicked => {
                stuff-visible = !stuff-visible;
            }
        }

        if stuff-visible: Rectangle {
            vertical-stretch: 0;
            HorizontalBox {
                alignment: start;
                Text {
                    text: "Stuff at bottom";
                }
            }
        }
    }
}

Environment Details

  • Slint Version: Tip
  • Platform/OS: Windows
  • Programming Language: Rust
  • Backend/Renderer: Default

Product Impact

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    need triagingIssue that the owner of the area still need to triage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions