Skip to content

Commit

Permalink
reafactoring / fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Jun 16, 2020
1 parent 0fda5b8 commit 2a26497
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions ImGuiFileDialog/ImGuiFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1822,10 +1822,8 @@ namespace igfd
if (fullStr[p] == '{') // {
{
infos.filter = fullStr.substr(lp, p - lp);

p++;

size_t lp = fullStr.find('}', p);
lp = fullStr.find('}', p);
if (lp != nan)
{
std::string fs = fullStr.substr(p, lp - p);
Expand All @@ -1835,7 +1833,6 @@ namespace igfd
infos.collectionfilters.emplace(a);
}
}

p = lp + 1;
}
else // ,
Expand Down Expand Up @@ -1905,8 +1902,8 @@ namespace igfd
std::string ImGuiFileDialog::OptimizeFilenameForSearchOperations(std::string vFileName)
{
// convert to lower case
for (auto & c : vFileName)
c = std::tolower(c);
for (char & c : vFileName)
c = (char)std::tolower(c);
return vFileName;
}

Expand Down Expand Up @@ -1945,11 +1942,11 @@ namespace igfd
////////////////////////////////////////////////////////////////////////////////////////////////

static size_t locateFileByInputChar_lastFileIdx = 0;
static char locateFileByInputChar_lastChar = 0;
static ImWchar locateFileByInputChar_lastChar = 0;
static int locateFileByInputChar_InputQueueCharactersSize = 0;
static bool locateFileByInputChar_lastFound = false;

bool ImGuiFileDialog::LocateItem_Loop(char vC)
bool ImGuiFileDialog::LocateItem_Loop(ImWchar vC)
{
bool found = false;

Expand Down Expand Up @@ -1997,7 +1994,7 @@ namespace igfd
// point by char
if (!ImGui::GetIO().InputQueueCharacters.empty())
{
char c = ImGui::GetIO().InputQueueCharacters.back();
ImWchar c = ImGui::GetIO().InputQueueCharacters.back();
if (locateFileByInputChar_InputQueueCharactersSize !=
ImGui::GetIO().InputQueueCharacters.size())
{
Expand Down Expand Up @@ -2150,7 +2147,7 @@ namespace igfd

void ImGuiFileDialog::SetFlashingAttenuationInSeconds(float vAttenValue)
{
m_FlashAlphaAttenInSecs = 1.0f / max(vAttenValue,0.01f);
m_FlashAlphaAttenInSecs = 1.0f / ImMax(vAttenValue,0.01f);
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion ImGuiFileDialog/ImGuiFileDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace igfd
#ifdef USE_EXPLORATION_BY_KEYS
private: // file localization by input chat // widget flashing
void LocateByInputKey();
bool LocateItem_Loop(char vC);
bool LocateItem_Loop(ImWchar vC);
void ExploreWithkeys();
static bool FlashableSelectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0,
bool vFlashing = false, const ImVec2& size = ImVec2(0, 0));
Expand Down

0 comments on commit 2a26497

Please sign in to comment.