- Lightweight and simple file dialog with embedded file browser
- Compatible with
imgui-rs
>= 0.11.0 - No extra dependencies
Basic usage:
use imfile::FileDialog;
fn main() {
// set up your imgui::Ui here
// This returns None if no file was selected
if let Some(file) = FileDialog::new()
.for_save() // Default is open
.title("Title") // Default is "Open File" or "Save file" depending on the dialog type
.accept_text("Open file") // Default is open
.dir_only() // Only allow directories instead of files
.spawn(&ui); // Create the dialog using the imgui::Ui
{
println!("File chosen: {}", file.display());
} else {
println!("No file selected.");
}
}
- Add icons for the widgets
- Add file filters
- Set side panel navigator (eg. Disk, Recents, ...)
The crate is licensed under the MIT license.