Open flukejones opened 1 year ago
Suppose we had a closed-event
callback. My feeling is that if close-on-click
is true, it should always be invoked - regardless of whether the user clicks inside or outside the bounds of the popup. If close-on-click
is false, then I think closed-event
should be invoked when close()
is called.
@FloVanGH @ogoffart thoughts? :)
i'd called it closed
(why -event?)
But the behavior you describe is fine. always call the closed
callback when the popup is closed
I was thinking -event
because it's in response to a mouse event. But since it doesn't have to be... you're right, just closed
is fine.
I can implement that if everyone else agrees. This seems straightforward (famous last words!).
Maybe this would allow to fix the original issue from https://github.com/slint-ui/slint/issues/456
Hello. I ran in the same issue.
With slints 1.8 Property Changed callbacks there is no need for an additional callback. We could leverage the visible
property.
Buuuut: the PopupWindow show/close function does not update the visible
-property.
I would expect that showing/closing the PopupWindow would change the visible property thus I can use the property changed callback.
Related to #3712
In some cases if the
PopupWindow
is closed by clicking outside of the bounds of its content, a callback that runs on this case could be handy for performing certain tasks such as closing or updating other widgets (thinking of "cancel" behaviour).The callback would be specific to clicking outside of the popup bounds, so that closing via other means does not produce unexpected results.