Open sourcebox opened 3 years ago
There's nothing really special about modals.
Just boxes drawn on top of other elements that has focus.
See the demo app:
https://emilk.github.io/egui/index.html
So you can draw the modal if a certain condition is met.
Then you can add buttons to it that closes the modal or triggers a HTTP request and then closes the modal or requests additional information from the user for example.
Hmm... The settings window in the demo is not modal, it loses focus when you click another window.
There is no modal windows in egui at the moment, but I suspect adding support for it would be pretty easy (just ignore interactions with the non-modal Area).
I wonder if one should also darken the background when showing a modal window?
I wonder if one should also darken the background when showing a modal window?
Something like that would be nice, so the user can easily recognize that his attention is required.
Definitely something that I'd be interested in having, as my current "project" would need to implement a sort of dialog boxes for data introduction! Thanks for hearing @sourcebox out, @emilk :)
I would like to open a PR that might solve this. Can I?
I had a look into the various areas of the demo and could not find anything. Is it already possible to use modal dialogs, e.g. for errors, user confirmation or an "about box" with credits?