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

Open a menu upwards instead of downwards #2176

Closed
jsguay-haven opened this issue Oct 21, 2022 · 0 comments · Fixed by #2191
Closed

Open a menu upwards instead of downwards #2176

jsguay-haven opened this issue Oct 21, 2022 · 0 comments · Fixed by #2191
Labels
feature New feature or request

Comments

@jsguay-haven
Copy link

This may be similar to #1176 but only in a general sense that if I use the egui::TopBottomPanel::bottom() and put a menu button in it, the menu still opens downwards so it's outside the screen.

Is your feature request related to a problem? Please describe.

I'd like to be able to have menu buttons on the egui::TopBottomPanel::bottom() panel, and have the menus open upwards.

Describe the solution you'd like

Ideally I think if a popup is going to open outside the screen it should be automatically repositioned to be inside the screen, as mentioned in the above issue.

Describe alternatives you've considered

I tried to write a version of popup_below_widget (called popup_above_widget) but I don't know how to get the size of the menu that would be created by add_contents(ui) in order to offset the popup (in .fixed_pos(...)). This is down to my lack of knowledge, so if this is something that's easy to answer, it may be sufficient to do what I want.

Additional context

Nothing to add really.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant