Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PopupWindow is clipped by Window #2375

Open
AllenDang opened this issue Mar 14, 2023 · 8 comments
Open

PopupWindow is clipped by Window #2375

AllenDang opened this issue Mar 14, 2023 · 8 comments
Labels
a:backend-winit Winit backend (mS,mO) bug Something isn't working priority:high Important issue that needs to be fixed before the next release

Comments

@AllenDang
Copy link

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?

@hunger
Copy link
Member

hunger commented Mar 16, 2023

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)?

@AllenDang
Copy link
Author

MacOS, Slint 0.3.5, winit femovg

@ogoffart
Copy link
Member

Winit doesn't implement popup window yet rust-windowing/winit#950 so we simulate them by drawing on the window.

The Qt backend supports popup window properly currently

@tp971
Copy link

tp971 commented Jun 15, 2023

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.

@tronical tronical added the bug Something isn't working label Jun 16, 2023
@ogoffart ogoffart added the a:backend-winit Winit backend (mS,mO) label Jul 13, 2023
@tronical
Copy link
Member

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.

@ogoffart ogoffart added the priority:high Important issue that needs to be fixed before the next release label Jan 16, 2024
@ogoffart ogoffart changed the title Popup is clipped by Window PopupWindow is clipped by Window Mar 17, 2024
@NRohner
Copy link

NRohner commented May 8, 2024

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.

@develcooking
Copy link

@BigBeast420 Yes it's possible but so far only as an custom widget. See in #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

@NRohner
Copy link

NRohner commented May 8, 2024

Thanks so much! I will check this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:backend-winit Winit backend (mS,mO) bug Something isn't working priority:high Important issue that needs to be fixed before the next release
Projects
None yet
Development

No branches or pull requests

7 participants