Open Enyium opened 6 days ago
Yes, that happens.
The problem is that there is no way to know when something changed size or position. So there is not reliable way to update the selection rectangle :-/
Demo
's minimum-width
changes. Is that not detectable?
In the snippet it works for me on the layout:
VerticalBox {
changed min-width => {
debug("new min-width \{self.min-width/1px}");
}
...
We do have an implementation of the layout_info for the component container, don't we? So maybe what's the previewed component here (Demo
) can be observed?
I am interested in changes to the size of the selected element, not the window. In this case one will change the other, but that is not true in general.
Since you're retrieving the size and position via the interpreter's API (element_positions
, etc.), maybe in case you want to track changes, use a PropertyTracker
? Or if you expose a call to such functions directly in Slint, then storing that in a property in Slint should update automatically (and work with changed XXX =>
).
I am interested in changes to the size of the selected element, not the window. In this case one will change the other, but that is not true in general.
I think the problem here is not the selected element, it is the constraint of the Window not being respected.
Eg, after clicking the button in the slintpad link from the description, i see this: but the text is bigger than that and so is the minimum size, and trying to resize the component shows that.
The problem is that there is no way to know when something changed size or position.
There are ways. Especially now with changed callback. In native code there is PropertyTracker.
So there is not reliable way to update the selection rectangle :-/
Yes there are ways, but this is anyway not what this issue is about.
Consider this SlintPad demo: