mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Reset scroll when search text changes. Fix #1331
This commit is contained in:
parent
a09fa562be
commit
5c4203b747
|
@ -4126,6 +4126,7 @@ void CEditor::RenderFileDialog()
|
|||
|
||||
static float s_SearchBoxID = 0;
|
||||
UI()->DoLabel(&FileBoxLabel, "Search:", 10.0f, -1, -1);
|
||||
str_copy(m_aFileDialogPrevSearchText, m_aFileDialogSearchText, sizeof(m_aFileDialogPrevSearchText));
|
||||
DoEditBox(&s_SearchBoxID, &FileBox, m_aFileDialogSearchText, sizeof(m_aFileDialogSearchText), 10.0f, &s_SearchBoxID,false,CUI::CORNER_L);
|
||||
|
||||
// clearSearchbox button
|
||||
|
@ -4139,6 +4140,9 @@ void CEditor::RenderFileDialog()
|
|||
UI()->SetActiveItem(&s_SearchBoxID);
|
||||
}
|
||||
}
|
||||
|
||||
if(str_comp(m_aFileDialogPrevSearchText, m_aFileDialogSearchText))
|
||||
m_FileDialogScrollValue = 0.0f;
|
||||
}
|
||||
|
||||
int Num = (int)(View.h/17.0f)+1;
|
||||
|
|
|
@ -840,6 +840,7 @@ public:
|
|||
char m_aFileDialogCurrentFolder[MAX_PATH_LENGTH];
|
||||
char m_aFileDialogCurrentLink[MAX_PATH_LENGTH];
|
||||
char m_aFileDialogSearchText[64];
|
||||
char m_aFileDialogPrevSearchText[64];
|
||||
char *m_pFileDialogPath;
|
||||
bool m_aFileDialogActivate;
|
||||
int m_FileDialogFileType;
|
||||
|
|
Loading…
Reference in a new issue