fluxxcode / egui-file-dialog

Full featured and customizable file dialog for egui
MIT License
86 stars 11 forks source link

Nice to have: Ability to make file open dialog modal (disable all other ui) #117

Closed crumblingstatue closed 5 months ago

crumblingstatue commented 5 months ago

Right now, there is no way (that I'm aware of) to make FileDialog modal, that is, make it disable all other ui until a file is selected. This makes it more difficult to prevent inconsistent state, because the user can trigger different underlying ui elements while the FileDialog is open, including ui elements for triggering multiple different actions that all use FileDialog. For example, an application might have multiple buttons for loading different things. And if the user clicks another button while a file dialog is already open, it could confuse a poorly written application, and it can also confuse the user (wait, what kind file am I picking again?) The easiest way to prevent this would be to have an option to make FileDialog modal.

The egui-modal crate is proof that it's possible to make a modal dialog, and it could be looked at to see how to implement this feature.