From cc9248877f83f651b9f5bd09eff64ea5d4af2410 Mon Sep 17 00:00:00 2001 From: alcomposer Date: Thu, 18 Jan 2024 00:18:25 +1030 Subject: [PATCH 1/2] directly clear search outliner when closing tab (don't stop timer, as currently that is what updates the panel) --- Source/PluginEditor.cpp | 1 + Source/Sidebar/SearchPanel.h | 9 +++++---- Source/Sidebar/Sidebar.cpp | 5 +++++ Source/Sidebar/Sidebar.h | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) 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..d29dbd16c 100644 --- a/Source/Sidebar/SearchPanel.h +++ b/Source/Sidebar/SearchPanel.h @@ -105,6 +105,11 @@ class SearchPanel : public Component, public KeyListener, public Timer { return false; } + + void clear() + { + patchTree.clearValueTree(); + } void timerCallback() override { @@ -115,10 +120,6 @@ class SearchPanel : public Component, public KeyListener, public Timer 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; From 025bd23bee20d7624f7d389831c60aa3b0560602 Mon Sep 17 00:00:00 2001 From: Timothy Schoen Date: Wed, 17 Jan 2024 15:36:56 +0100 Subject: [PATCH 2/2] Fixed bug when dragging tab out of window with search panel open --- Source/Sidebar/SearchPanel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Sidebar/SearchPanel.h b/Source/Sidebar/SearchPanel.h index d29dbd16c..f73e43535 100644 --- a/Source/Sidebar/SearchPanel.h +++ b/Source/Sidebar/SearchPanel.h @@ -114,7 +114,7 @@ class SearchPanel : public Component, public KeyListener, public Timer 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;