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.
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 theFileDialog
is open, including ui elements for triggering multiple different actions that all useFileDialog
. 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 makeFileDialog
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.