diff --git a/ImGuiFileDialog/ImGuiFileDialog.cpp b/ImGuiFileDialog/ImGuiFileDialog.cpp index f0b401d..cfd7a7b 100644 --- a/ImGuiFileDialog/ImGuiFileDialog.cpp +++ b/ImGuiFileDialog/ImGuiFileDialog.cpp @@ -1271,16 +1271,19 @@ namespace igfd bool found = false; int itemIdx = 0; const char* p = dlg_filters; - while (*p) + if (p) { - if (m_SelectedExt == std::string(p)) + while (*p) { - found = true; - FilterIndex = itemIdx; - break; + if (m_SelectedExt == std::string(p)) + { + found = true; + FilterIndex = itemIdx; + break; + } + p += strlen(p) + 1; + itemIdx++; } - p += strlen(p) + 1; - itemIdx++; } if (!found) { diff --git a/README.md b/README.md index 1b5d68b..3b098ad 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,16 @@ ImVec2 minSize = maxSize * 0.5f; igfd::ImGuiFileDialog::Instance()->FileDialog("ChooseFileDlgKey", ImGuiWindowFlags_NoCollapse, minSize, maxSize); ``` -![alt text](doc/contraintDisplay.gif) +![alt text](doc/dialog_constraints.gif) + +## Detail View Mode + +You can have tables display like that. + +- you need to use imgui tables branch (not merged in master at this moment) +- uncomment "#define USE_IMGUI_TABLES" in you custom config file (CustomImGuiFileDialogConfig.h in this example) + +![alt text](doc/imgui_tables_branch.gif) ## Using ImGuiFileDialog as a module diff --git a/doc/dialog_constraints.gif b/doc/dialog_constraints.gif new file mode 100644 index 0000000..19a1882 Binary files /dev/null and b/doc/dialog_constraints.gif differ diff --git a/doc/imgui_tables_branch.gif b/doc/imgui_tables_branch.gif new file mode 100644 index 0000000..08e6b21 Binary files /dev/null and b/doc/imgui_tables_branch.gif differ