emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.63k stars 1.49k forks source link

Unify menus with tooltips/popups #4607

Open emilk opened 3 weeks ago

emilk commented 3 weeks ago

egui menus (Ui::menu_button) and context menus (Response::context_menu) are implemented using the egui::menu module.

There are also tooltips (Response::on_hover_ui etc) and ComboBox popups, both implemented using egui::containers::popup.

It would be nice to unify these systems.

Things I would like to accomplish:

At the same time it would be great to take a naming pass on all these things, and look up what they are commonly called in other ui libraries.

Umatriz commented 3 weeks ago

I would like to try to implement this. But I also want to be able to change the way egui::containers::popups are closed. Because for now if I add any kind of checkboxed into it or anything else that requires some kind of interaction the popup will immediately close as soon as I change something (mark a checkbox or press a button). I think it's better to let user to take control of it. Simitarly to the ui.menu_button and it's ui.close_menu.

Umatriz commented 3 weeks ago

I think I will make a PR and write all my thoughts about this isssue.

emilk commented 3 weeks ago

Nice! I suspect there is a lot in menu.rs that can be simplified too