You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library supports favorites, actual Windows icons, image previews, zooming in, etc...
DISCLAIMER: This library was designed and built for use in SHADERed - it uses older version of Dear ImGui so some changes might be required to get it compiled. The way the file filter and the library itself looks was also limited due to me not wanting to break SHADERed's plugins.
Requirements
This library uses C++17's std::filesystem but it also needs these libraries:
Open a file dialog on button press (just an example):
if (ImGui::Button("Open a texture"))
ifd::FileDialog::Instance().Open("TextureOpenDialog", "Open a texture", "Image file (*.png;*.jpg;*.jpeg;*.bmp;*.tga){.png,.jpg,.jpeg,.bmp,.tga},.*");
Render and check if done:
if (ifd::FileDialog::Instance().IsDone("TextureOpenDialog")) {
if (ifd::FileDialog::Instance().HasResult()) {
std::string res = ifd::FileDialog::Instance().GetResult().u8string();
printf("OPEN[%s]\n", res.c_str());
}
ifd::FileDialog::Instance().Close();
}
File filter syntax:
Name1 {.ext1,.ext2}, Name2 {.ext3,.ext4},.*
Running the example
If you want to test ImFileDialog, run these commands:
cmake .
make
./ImFileDialogExample
Screenshots
1. Table view:
2. Icon view:
3. Zooming in:
4. Favorites:
5. Image preview + threading (CTRL + scroll):
TODO
selecting multiple files
preview pane / layout options
LICENSE
ImFileDialog is licensed under MIT license. See LICENSE for more details.