-
I have this demo: import { Button } from "std-widgets.slint";
export component Demo {
width: 300px;
height: 300px;
Rectangle {
background: lime;
Rectangle {
background: fuchsia;
//width: button.width;
//height: button.height;
width: button.preferred-width;
height: button.preferred-height;
button := Button {
//width: self.preferred-width;
//height: self.preferred-height;
text: "Foo";
}
}
}
} When you change around the styles a bit, the
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It looks like the Button's min-height is bigger than its preferred-size. I'd say this is either a bug in the Widgets implementation as they don't specify a preferred size. Or the bug is that the auto-computation of the preferred size should take the explicit minimum size into account. |
Beta Was this translation helpful? Give feedback.
It looks like the Button's min-height is bigger than its preferred-size.
It sounds like a bug, but not sure on what level.
The Button's specifies a minimum size. But the preferred size is automatically computed based on the contents.
When the width of the button is computed, its minimum size is taken into account, but the size of the fuchsia rectangle it taking the actual preferred-size because of the binding.
I'd say this is either a bug in the Widgets implementation as they don't specify a preferred size. Or the bug is that the auto-computation of the preferred size should take the explicit minimum size into account.