mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-26 06:25:16 +00:00
fix more crashes on the file dialog
oh yes, the wonders of dealing with this useless broken file dialog. honestly I didn't think it was broken to this point... and no, I don't want to use the **other** file dialog as it requires C++17 which is too ahead of time
This commit is contained in:
parent
b091404d63
commit
f32f079ef8
1 changed files with 5 additions and 5 deletions
10
extern/igfd/ImGuiFileDialog.cpp
vendored
10
extern/igfd/ImGuiFileDialog.cpp
vendored
|
@ -1524,10 +1524,10 @@ namespace IGFD
|
|||
}
|
||||
#else // dirent
|
||||
struct dirent** files = nullptr;
|
||||
size_t n = scandir(path.c_str(), &files, nullptr, inAlphaSort);
|
||||
if (n)
|
||||
int n = scandir(path.c_str(), &files, nullptr, inAlphaSort);
|
||||
if (n>0)
|
||||
{
|
||||
size_t i;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
|
@ -2342,13 +2342,13 @@ namespace IGFD
|
|||
if (puFileManager.puInputPathActivated)
|
||||
{
|
||||
auto gio = ImGui::GetIO();
|
||||
if (ImGui::IsKeyReleased(gio.KeyMap[ImGuiKey_Enter]))
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_Enter))
|
||||
{
|
||||
puFileManager.SetCurrentPath(std::string(puFileManager.puInputPathBuffer));
|
||||
puFileManager.OpenCurrentPath(*this);
|
||||
puFileManager.puInputPathActivated = false;
|
||||
}
|
||||
if (ImGui::IsKeyReleased(gio.KeyMap[ImGuiKey_Escape]))
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_Escape))
|
||||
{
|
||||
puFileManager.puInputPathActivated = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue