Skip to content

Commit

Permalink
plugin: delay window construction until needed
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepVanlier committed Sep 15, 2024
1 parent 51bbf27 commit ba7c549
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/ysfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ YSFX_DEFINE_AUTO_PTR(ysfx_menu_u, ysfx_menu_t, ysfx_menu_free);
return sptr(ptr, sptr##_deleter()); \
}

YSFX_DEFINE_SHARED_PTR(ysfx_bank_shared, ysfx_bank_t, ysfx_bank_free);
YSFX_DEFINE_SHARED_PTR(ysfx_bank_shared, ysfx_bank_t, ysfx_bank_free)

#endif // defined(__cplusplus) && (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSVC_LANG >= 201103L))

Expand Down
1 change: 1 addition & 0 deletions plugin/components/ide_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ YsfxIDEView::YsfxIDEView()
m_impl->relayoutUILater();

m_impl->setupNewFx();
this->setVisible(false);
}

YsfxIDEView::~YsfxIDEView()
Expand Down
10 changes: 6 additions & 4 deletions plugin/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ void YsfxEditor::Impl::switchEditor(bool showGfx)

void YsfxEditor::Impl::openCodeEditor()
{
if (!m_codeWindow) {
m_codeWindow.reset(new CodeWindow(TRANS("Edit"), m_self->findColour(juce::DocumentWindow::backgroundColourId), juce::DocumentWindow::allButtons));
m_codeWindow->setResizable(true, false);
m_codeWindow->setContentNonOwned(m_ideView.get(), true);
}

m_codeWindow->setVisible(true);
m_codeWindow->toFront(true);
m_ideView->focusOnCodeEditor();
Expand Down Expand Up @@ -798,11 +804,7 @@ void YsfxEditor::Impl::createUI()
m_miniParametersPanel.reset(new YsfxParametersPanel);
m_graphicsView.reset(new YsfxGraphicsView);
m_ideView.reset(new YsfxIDEView);
m_ideView->setVisible(true);
m_ideView->setSize(1000, 600);
m_codeWindow.reset(new CodeWindow(TRANS("Edit"), m_self->findColour(juce::DocumentWindow::backgroundColourId), juce::DocumentWindow::allButtons));
m_codeWindow->setResizable(true, false);
m_codeWindow->setContentNonOwned(m_ideView.get(), true);
m_tooltipWindow.reset(new juce::TooltipWindow);
}

Expand Down

0 comments on commit ba7c549

Please sign in to comment.