From eddfa9bcd9abef4968ee8d7adf56f6ce619e49a5 Mon Sep 17 00:00:00 2001 From: James Ball Date: Fri, 22 Dec 2023 14:41:52 +0000 Subject: [PATCH] Enable all buttons on native title bar --- Source/PluginEditor.cpp | 7 ++++++- Source/PluginProcessor.cpp | 6 ------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index a123fa29..fcc497ed 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -56,7 +56,12 @@ OscirenderAudioProcessorEditor::OscirenderAudioProcessorEditor(OscirenderAudioPr if (audioProcessor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone) { if (juce::TopLevelWindow::getNumTopLevelWindows() == 1) { juce::TopLevelWindow* w = juce::TopLevelWindow::getTopLevelWindow(0); - w->setColour(juce::ResizableWindow::backgroundColourId, Colours::veryDark); + juce::DocumentWindow* dw = dynamic_cast(w); + if (dw != nullptr) { + dw->setColour(juce::ResizableWindow::backgroundColourId, Colours::veryDark); + dw->setTitleBarButtonsRequired(juce::DocumentWindow::allButtons, false); + dw->setUsingNativeTitleBar(true); + } } } diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 0b15509f..350f343c 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -645,12 +645,6 @@ bool OscirenderAudioProcessor::hasEditor() const { juce::AudioProcessorEditor* OscirenderAudioProcessor::createEditor() { auto editor = new OscirenderAudioProcessorEditor(*this); - if (wrapperType == wrapperType_Standalone) { - if (juce::TopLevelWindow::getNumTopLevelWindows() == 1) { - juce::TopLevelWindow* w = juce::TopLevelWindow::getTopLevelWindow(0); - w->setUsingNativeTitleBar(true); - } - } return editor; }