slint
slint copied to clipboard
ComboBox: Popup position and width does not adjust to window resizes
Slint v1.7.0
This is strange. I see you're using Windows, and I tried to reproduce this, but... for me the popup comes up at the right location. Is this the live-preview from the VS code extension?
@tronical First picture is live-preview from the VS code extension yes, to reproduce resize the window while popup is displayed
Got it, thank you! Yes, that's a bug.
I suppose that we should pass in the x/y into show_popup as Pin<&Property<..>> so that we read them every time we render.
For the CI failure, I pushed a prospective fix. Could you rebase?
btw, it's same bug for popup width too not just x and y
I tried to play with property binding <=> for x and y in combobox.slint in the source but didn't know how to fix it.
Note that native popups / combobox disallow resizing while the popup is visible. So I wonder if the fix here is not to close the popup when we detect that the window is being resized. (especially if close-on-click is true)
So I wonder if the fix here is not to close the popup when we detect that the window is being resized. (especially if close-on-click is true)
What if the window manager resizes the window by itself, for example due to a screen size change?
Also, for wasm builds that won't work as the user can continue to resize the canvas.
What I mean is that we close the active_popup in https://github.com/slint-ui/slint/blob/master/internal/core/api.rs#L611 when receiving the event.
I believe this would also happen with a native popup, they'd be closed too with this kind of screen changes.