pub struct DialogManager { /* private fields */ }Expand description
Manager for multiple in-UI file browser dialogs (IGFD-style open/display separation).
This is an incremental step toward IGFD-grade behavior:
- Multiple dialogs can exist concurrently (each keyed by a
DialogId). - The caller opens a dialog (
open_browser*) and later drives rendering per-frame viashow_*/draw_*.
Implementations§
Source§impl DialogManager
impl DialogManager
Sourcepub fn with_fs(fs: Box<dyn FileSystem>) -> Self
pub fn with_fs(fs: Box<dyn FileSystem>) -> Self
Create a new manager using a custom filesystem.
Sourcepub fn set_fs(&mut self, fs: Box<dyn FileSystem>)
pub fn set_fs(&mut self, fs: Box<dyn FileSystem>)
Replace the manager filesystem.
Sourcepub fn fs(&self) -> &dyn FileSystem
pub fn fs(&self) -> &dyn FileSystem
Get a shared reference to the manager filesystem.
Sourcepub fn open_browser(&mut self, mode: DialogMode) -> DialogId
pub fn open_browser(&mut self, mode: DialogMode) -> DialogId
Open a new in-UI file browser dialog with a default state.
Sourcepub fn open_browser_with_state(&mut self, state: FileDialogState) -> DialogId
pub fn open_browser_with_state(&mut self, state: FileDialogState) -> DialogId
Open a new in-UI file browser dialog with a fully configured state.
Sourcepub fn close(&mut self, id: DialogId) -> Option<FileDialogState>
pub fn close(&mut self, id: DialogId) -> Option<FileDialogState>
Close an open dialog and return its state (if any).
Sourcepub fn dialog_state(&self, id: DialogId) -> Option<&FileDialogState>
pub fn dialog_state(&self, id: DialogId) -> Option<&FileDialogState>
Get immutable access to a dialog state.
Sourcepub fn dialog_state_mut(&mut self, id: DialogId) -> Option<&mut FileDialogState>
pub fn dialog_state_mut(&mut self, id: DialogId) -> Option<&mut FileDialogState>
Get mutable access to a dialog state (to tweak filters/layout/etc).
Sourcepub fn show_browser(
&mut self,
ui: &Ui,
id: DialogId,
) -> Option<Result<Selection, FileDialogError>>
pub fn show_browser( &mut self, ui: &Ui, id: DialogId, ) -> Option<Result<Selection, FileDialogError>>
Draw a dialog hosted in its own ImGui window (default host config).
If a result is produced (confirm/cancel), the dialog is removed from the manager and the result is returned.
Sourcepub fn show_browser_windowed(
&mut self,
ui: &Ui,
id: DialogId,
cfg: &WindowHostConfig,
) -> Option<Result<Selection, FileDialogError>>
pub fn show_browser_windowed( &mut self, ui: &Ui, id: DialogId, cfg: &WindowHostConfig, ) -> Option<Result<Selection, FileDialogError>>
Draw a dialog hosted in an ImGui window using custom window configuration.
If a result is produced (confirm/cancel), the dialog is removed from the manager and the result is returned.
Sourcepub fn draw_browser_contents(
&mut self,
ui: &Ui,
id: DialogId,
) -> Option<Result<Selection, FileDialogError>>
pub fn draw_browser_contents( &mut self, ui: &Ui, id: DialogId, ) -> Option<Result<Selection, FileDialogError>>
Draw only the dialog contents (no host window) for embedding.
If a result is produced (confirm/cancel), the dialog is removed from the manager and the result is returned.