slint icon indicating copy to clipboard operation
slint copied to clipboard

`Dialog` buttons are sometimes stretched

Open Enyium opened this issue 1 year ago • 0 comments
trafficstars

Under certain circumstances, Dialog buttons are stretched, which should never happen, because it looks awful (SlintPad):

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

export component UserAgreement inherits Dialog {
    VerticalBox {
        alignment: start;

        Text {
            text: "Lorem ipsum dolor sit amet,\nconsetetur sadipscing elitr\n...";
        }
    }

    Button {
        text: "I Agree";
        dialog-button-role: accept;
    }

    Button {
        text: "Quit";
        dialog-button-role: reject;
    }
}

stretched-dialog-buttons

It seems you can just use vertical-stretch: 100%; on your body element. But since the user doesn't use a VerticalLayout themselves that includes the Dialog buttons, this isn't readily obvious, and Dialog should behave more according to expectations from the get-go.

Enyium avatar Oct 14 '24 09:10 Enyium