Adds a more compact Clear button to Check Tracker search (#6401)
This commit is contained in:
committed by
GitHub
parent
c439d62137
commit
5fe4680a20
@@ -1082,13 +1082,21 @@ void CheckTrackerWindow::DrawElement() {
|
||||
}
|
||||
UIWidgets::PushStyleCombobox(THEME_COLOR);
|
||||
if (CVarGetInteger(CVAR_TRACKER_CHECK("SearchInputVisible"), 1)) {
|
||||
if (checkSearch.Draw("", ImGui::GetContentRegionAvail().x - 6)) {
|
||||
if (checkSearch.Draw("", ImGui::GetContentRegionAvail().x - 42)) {
|
||||
UpdateFilters();
|
||||
}
|
||||
std::string checkSearchText = "";
|
||||
checkSearchText = checkSearch.InputBuf;
|
||||
std::string checkSearchText = checkSearch.InputBuf;
|
||||
checkSearchText.erase(std::remove(checkSearchText.begin(), checkSearchText.end(), ' '),
|
||||
checkSearchText.end());
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button(ICON_FA_ERASER, UIWidgets::ButtonOptions()
|
||||
.Size(UIWidgets::Sizes::Inline)
|
||||
.Color(THEME_COLOR)
|
||||
.Padding(ImVec2(10.f, 6.f)))) {
|
||||
checkSearch.Clear();
|
||||
UpdateFilters();
|
||||
doAreaScroll = true;
|
||||
}
|
||||
if (checkSearchText.length() < 1) {
|
||||
ImGui::SameLine(20.0f);
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 0.4f), "Search...");
|
||||
|
||||
Reference in New Issue
Block a user