Skip to content

Commit 2a26497

Browse files
committed
reafactoring / fix
1 parent 0fda5b8 commit 2a26497

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

ImGuiFileDialog/ImGuiFileDialog.cpp

+7-10
Original file line numberDiff line numberDiff line change
@@ -1822,10 +1822,8 @@ namespace igfd
18221822
if (fullStr[p] == '{') // {
18231823
{
18241824
infos.filter = fullStr.substr(lp, p - lp);
1825-
18261825
p++;
1827-
1828-
size_t lp = fullStr.find('}', p);
1826+
lp = fullStr.find('}', p);
18291827
if (lp != nan)
18301828
{
18311829
std::string fs = fullStr.substr(p, lp - p);
@@ -1835,7 +1833,6 @@ namespace igfd
18351833
infos.collectionfilters.emplace(a);
18361834
}
18371835
}
1838-
18391836
p = lp + 1;
18401837
}
18411838
else // ,
@@ -1905,8 +1902,8 @@ namespace igfd
19051902
std::string ImGuiFileDialog::OptimizeFilenameForSearchOperations(std::string vFileName)
19061903
{
19071904
// convert to lower case
1908-
for (auto & c : vFileName)
1909-
c = std::tolower(c);
1905+
for (char & c : vFileName)
1906+
c = (char)std::tolower(c);
19101907
return vFileName;
19111908
}
19121909

@@ -1945,11 +1942,11 @@ namespace igfd
19451942
////////////////////////////////////////////////////////////////////////////////////////////////
19461943

19471944
static size_t locateFileByInputChar_lastFileIdx = 0;
1948-
static char locateFileByInputChar_lastChar = 0;
1945+
static ImWchar locateFileByInputChar_lastChar = 0;
19491946
static int locateFileByInputChar_InputQueueCharactersSize = 0;
19501947
static bool locateFileByInputChar_lastFound = false;
19511948

1952-
bool ImGuiFileDialog::LocateItem_Loop(char vC)
1949+
bool ImGuiFileDialog::LocateItem_Loop(ImWchar vC)
19531950
{
19541951
bool found = false;
19551952

@@ -1997,7 +1994,7 @@ namespace igfd
19971994
// point by char
19981995
if (!ImGui::GetIO().InputQueueCharacters.empty())
19991996
{
2000-
char c = ImGui::GetIO().InputQueueCharacters.back();
1997+
ImWchar c = ImGui::GetIO().InputQueueCharacters.back();
20011998
if (locateFileByInputChar_InputQueueCharactersSize !=
20021999
ImGui::GetIO().InputQueueCharacters.size())
20032000
{
@@ -2150,7 +2147,7 @@ namespace igfd
21502147

21512148
void ImGuiFileDialog::SetFlashingAttenuationInSeconds(float vAttenValue)
21522149
{
2153-
m_FlashAlphaAttenInSecs = 1.0f / max(vAttenValue,0.01f);
2150+
m_FlashAlphaAttenInSecs = 1.0f / ImMax(vAttenValue,0.01f);
21542151
}
21552152
#endif
21562153
}

ImGuiFileDialog/ImGuiFileDialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ namespace igfd
248248
#ifdef USE_EXPLORATION_BY_KEYS
249249
private: // file localization by input chat // widget flashing
250250
void LocateByInputKey();
251-
bool LocateItem_Loop(char vC);
251+
bool LocateItem_Loop(ImWchar vC);
252252
void ExploreWithkeys();
253253
static bool FlashableSelectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0,
254254
bool vFlashing = false, const ImVec2& size = ImVec2(0, 0));

0 commit comments

Comments
 (0)