From a25a3be4d1f20136b3986b5006c9bf876acf37e5 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Sat, 3 Feb 2024 23:36:14 +0400 Subject: [PATCH] effect searching --- src/gui/effectList.cpp | 6 ++++-- src/gui/gui.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index 45df6f2af..0cf1b4004 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -17,8 +17,9 @@ void FurnaceGUI::drawEffectList() { ImGui::PushTextWrapPos(availB); ImGui::TextWrapped("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); ImGui::PopTextWrapPos(); - ImGui::SameLine(); } + effectSearch.Draw(); + ImGui::SameLine(); ImGui::Button(ICON_FA_BARS "##SortEffects"); if (ImGui::BeginPopupContextItem("effectSort",ImGuiPopupFlags_MouseButtonLeft)) { for (int i=1; i<10; i++) { @@ -65,7 +66,8 @@ void FurnaceGUI::drawEffectList() { } } } - if (name!=NULL && effectsShow[fxColors[i]-GUI_COLOR_PATTERN_EFFECT_INVALID]) { + if (name==NULL) continue; + if (effectSearch.PassFilter(name) && effectsShow[fxColors[i]-GUI_COLOR_PATTERN_EFFECT_INVALID]) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::PushFont(patFont); diff --git a/src/gui/gui.h b/src/gui/gui.h index 8562467c0..8be24fdd2 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2345,8 +2345,9 @@ class FurnaceGUI { int pianoOffset, pianoOffsetEdit; int pianoView, pianoInputPadMode; - // effect sorting + // effect sorting / searching bool effectsShow[10]; + ImGuiTextFilter effectSearch; // TX81Z bool hasACED;