Open AllenDang opened 1 year ago
Sorry for you not getting a timely reply! Everybody is at Embedded World in Nuremberg right now.
What kind of environment are you running in (OS/windowing system/slint backend)?
MacOS, Slint 0.3.5, winit femovg
Winit doesn't implement popup window yet https://github.com/rust-windowing/winit/issues/950 so we simulate them by drawing on the window.
The Qt backend supports popup window properly currently
To add to this: even if the popup window is drawn beyond the main window, if the main window is at the bottom of the screen and the combobox is at the bottom of the window, the popup menu goes outside the screen. It should go up instead, or be moved up such that it's still fully visible on screen.
I think there's enough infrastructure / exposed API in winit now that we can implement Popups at least on some platforms as separate windows.
On Windows, when the window is created with WindowBuilderExtWindows::with_owner_window
, winit sets the style to popup.
On X11, create the window with with_parent_window
and use X11WindowBuilderAttributes::x11_window_types
to set _NET_WM_WINDOW_TYPE_POPUP_MENU
.
I'm not sure what to do on macOS yet (maybe the nswindow can be manipulated directly?), and on wayland perhaps xdg_popup
could be implemented on top.
Would it be possible to get a combo box with scrolling? When there are many items in the box its almost impossible to access them all without having some sort of scroll functionality.
@BigBeast420 Yes it's possible but so far only as an custom widget. See in https://github.com/slint-ui/slint/discussions/2657 This is written in Slint 1.0.2 so you have to change "choices" to "model"
Also the theme is way of . I would recommend to you that you use slint.dev/doc/palette I'm currently also in search of a better implementaion that would fit in to the fluent design that I'm currently using
Thanks so much! I will check this out.
If I put a combobox at the very bottom of window, it's drop down popup will be totally clipped, seems the popup is drawn within the window.
I guess it is the current limitation of how popup is implemented.
Is it possible to create a popup as a model window which could be fully displayed outside main window's boundary?