Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Window Resize Bug #4333

Closed
scout0773 opened this issue Jan 13, 2024 · 1 comment
Closed

Infinite Window Resize Bug #4333

scout0773 opened this issue Jan 13, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@scout0773
Copy link

Just messing around with slint ui and Rust. Found this weird bug that I haven't seen mentioned elsewhere so maybe I'm the first one to experience it, not sure. Down below is my appwindow.slint file, and after running cargo run everything works fine until you try to resize the window. It starts to extend to the right side of my screen infinitely. Here's a video of what happens: https://streamable.com/rges9v
Working on a Macbook Air M2 by the way so I don't know how relevant that'll be.

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

export component AppWindow inherits Window {
    VerticalLayout {
        padding: 10px;
        spacing: 10px;
        Text {
            text: "IronPass";
            horizontal-alignment: center;
            font-size: 24px;
            font-weight: 900;
        }

        CheckBox {
            width: parent.width;
            height: 15px;
            text: "Uppercase";
        }

        CheckBox {
            width: parent.width;
            height: 15px;
            text: "Lowercase";
        }

        CheckBox {
            width: parent.width;
            height: 15px;
            text: "Numbers";
        }

        CheckBox {
            width: parent.width;
            height: 15px;
            text: "Special characters";
        }
    }
}
@ogoffart
Copy link
Member

Thanks a lot for filling an issue!

This is the same issue as #2902

width: parent.width; cause the CheckBox's size constraints to be the same size of the layout. But the layout need to add some space for the padding. So the size constrinats of the layout becomes bigger than its current size, and on the next frame the window is resized to accomodate for that.
The fix here is to remove the width: parent.width; as the layout does that automatically anyway.
We should ideally detect such loop at compile time: #3997

Closing as duplicated of #2902 , but thanks anyway for reporting.

@ogoffart ogoffart closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2024
@hunger hunger added the duplicate This issue or pull request already exists label Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants