Skip to content

Commit be75c27

Browse files
committed
Merge branch 'Lib_Only' of https://github.com/aiekick/ImGuiFileDialog into Lib_Only
2 parents 541ac2c + 66d1bdc commit be75c27

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ namespace IGFD
638638
window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_ToggledSelection;
639639

640640
// Render
641-
if (held && (flags & ImGuiSelectableFlags_DrawHoveredWhenHeld) || vFlashing)
641+
if ((held && (flags & ImGuiSelectableFlags_DrawHoveredWhenHeld)) || vFlashing)
642642
hovered = true;
643643
if (hovered || selected)
644644
{
@@ -1415,7 +1415,7 @@ namespace IGFD
14151415
}
14161416
else
14171417
{
1418-
ImGui::Text("");
1418+
ImGui::Text("%s ", "");
14191419
}
14201420
}
14211421
if (ImGui::TableNextColumn()) // file date + time
@@ -2007,6 +2007,15 @@ namespace IGFD
20072007
std::sort(m_FileList.begin(), m_FileList.end(),
20082008
[](const FileInfoStruct& a, const FileInfoStruct& b) -> bool
20092009
{
2010+
if (a.fileName[0] == '.' && b.fileName[0] != '.') return true;
2011+
if (a.fileName[0] != '.' && b.fileName[0] == '.') return false;
2012+
if (a.fileName[0] == '.' && b.fileName[0] == '.')
2013+
{
2014+
if (a.fileName.length() == 1) return false;
2015+
if (b.fileName.length() == 1) return true;
2016+
return (stricmp(a.fileName.c_str() + 1, b.fileName.c_str() + 1) < 0);
2017+
}
2018+
20102019
if (a.type != b.type) return (a.type == 'd'); // directory in first
20112020
return (stricmp(a.fileName.c_str(), b.fileName.c_str()) < 0); // sort in insensitive case
20122021
});
@@ -2019,6 +2028,15 @@ namespace IGFD
20192028
std::sort(m_FileList.begin(), m_FileList.end(),
20202029
[](const FileInfoStruct& a, const FileInfoStruct& b) -> bool
20212030
{
2031+
if (a.fileName[0] == '.' && b.fileName[0] != '.') return false;
2032+
if (a.fileName[0] != '.' && b.fileName[0] == '.') return true;
2033+
if (a.fileName[0] == '.' && b.fileName[0] == '.')
2034+
{
2035+
if (a.fileName.length() == 1) return true;
2036+
if (b.fileName.length() == 1) return false;
2037+
return (stricmp(a.fileName.c_str() + 1, b.fileName.c_str() + 1) > 0);
2038+
}
2039+
20222040
if (a.type != b.type) return (a.type != 'd'); // directory in last
20232041
return (stricmp(a.fileName.c_str(), b.fileName.c_str()) > 0); // sort in insensitive case
20242042
});

ImGuiFileDialogConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//#define FILTER_COMBO_WIDTH 120.0f
2323
// button widget use for compose path
2424
//#define IMGUI_PATH_BUTTON ImGui::Button
25-
// standar button
25+
// standard button
2626
//#define IMGUI_BUTTON ImGui::Button
2727

2828
// locales string

0 commit comments

Comments
 (0)