slint
slint copied to clipboard
`Dialog` buttons are sometimes stretched
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;
}
}
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.