diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 044c3f0c5..df2e4db1c 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -808,6 +808,7 @@ void PluginEditor::closeTab(Canvas* cnv) auto patch = cnv->refCountedPatch; sidebar->hideParameters(); + sidebar->clearSearchOutliner(); patch->setVisible(false); diff --git a/Source/Sidebar/SearchPanel.h b/Source/Sidebar/SearchPanel.h index f51366aaf..f73e43535 100644 --- a/Source/Sidebar/SearchPanel.h +++ b/Source/Sidebar/SearchPanel.h @@ -105,20 +105,21 @@ class SearchPanel : public Component, public KeyListener, public Timer { return false; } + + void clear() + { + patchTree.clearValueTree(); + } void timerCallback() override { auto* cnv = editor->getCurrentCanvas(); - if(currentCanvas.getComponent() != cnv || (cnv && cnv->needsSearchUpdate)) + if(cnv && (currentCanvas.getComponent() != cnv || cnv->needsSearchUpdate)) { currentCanvas = cnv; currentCanvas->needsSearchUpdate = false; updateResults(); } - if (!cnv) { - patchTree.clearValueTree(); - stopTimer(); - } } void visibilityChanged() override diff --git a/Source/Sidebar/Sidebar.cpp b/Source/Sidebar/Sidebar.cpp index 0580564de..ad622e797 100644 --- a/Source/Sidebar/Sidebar.cpp +++ b/Source/Sidebar/Sidebar.cpp @@ -408,3 +408,8 @@ void Sidebar::updateConsole(int numMessages, bool newWarning) console->update(); } + +void Sidebar::clearSearchOutliner() +{ + searchPanel->clear(); +} diff --git a/Source/Sidebar/Sidebar.h b/Source/Sidebar/Sidebar.h index 945b7352c..55beda8e1 100644 --- a/Source/Sidebar/Sidebar.h +++ b/Source/Sidebar/Sidebar.h @@ -116,6 +116,8 @@ class Sidebar : public Component void clearConsole(); void updateConsole(int numMessages, bool newWarning); + void clearSearchOutliner(); + void updateAutomationParameters(); static constexpr int dragbarWidth = 6;