slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.47k stars 598 forks source link

Preview: when clicking "show preview" the size of the preview adjust but not the frame #5954

Closed ogoffart closed 1 month ago

ogoffart commented 2 months ago

In the master branch only.

For example with this simple slint code:

component Bar {
    width: 100%;
    height: 100%;
    Rectangle { background: lime; }
}

export component Foo {
    Bar {}
}

Resize the preview to some random size. Click "show preview" The preview resizes (to match a preferreed size which isn't set) (OK). But the frames doesn't follow immediatly.

Original comment

Right, the master branch SlintPad you linked doesn't have this error. However, there's the following succession of previews:

After first pasting the code:

1

After pressing "Show Preview" on Bar and then on Foo:

2

After again pressing "Show Preview" on Foo:

3

Originally posted by @Enyium in https://github.com/slint-ui/slint/issues/5949#issuecomment-2310379818

Edit: Updated the code example to include Foo and Bar.

hunger commented 2 months ago

That's an interesting issue: In the middle picture the resize handles are in the right place, but the box that goes with those is not.