slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.93k stars 565 forks source link

PopupWindow (of a ComboBox or menu) should be able to adjust its position to fit in the screen #4870

Open jakobhellermann opened 6 months ago

jakobhellermann commented 6 months ago

When a PopupWindow is about to be shown in way that it would be cut by the end of the screen (or the window, for inline popup), we should actually place that popup in a proper place.

Wayland uses a concept of positioner: https://wayland.app/protocols/xdg-shell#xdg_positioner

the PopupWindow should have an anchor rectangle and so on so that the platform can petition the popup properly.

Original message

basically https://github.com/slint-ui/slint/issues/3345 for the case where the ComboBox is at the bottom of the screen, which wasn't fixed yet as acknowledged in https://github.com/slint-ui/slint/pull/3861.

image

ogoffart commented 6 months ago

Thanks for filling an issue.

The first bug is that the popup is being clipped by the window. This is tracked in https://github.com/slint-ui/slint/issues/2375

Even if that problem was fixed, we would still have a problem if we were at the bottom of the screen, so we'd need a way to move the popup depending on its position on the screen.

Enyium commented 5 days ago

Even if that problem was fixed, we would still have a problem if we were at the bottom of the screen, so we'd need a way to move the popup depending on its position on the screen.

Note that, for cases like this, Windows provides system settings. Although this may not apply to combo boxes specifically.