From de278cf555545ced598883eff1f44e036b3cc771 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 24 Mar 2021 16:43:25 +0000 Subject: [PATCH] AudioPluginHost: Allow resizing plugins from the host, and increase border size on mobile The increased border size should make it slightly less fiddly to tap on the window border. --- extras/AudioPluginHost/Source/UI/PluginWindow.h | 11 +++++++++++ .../lookandfeel/juce_LookAndFeel_V4.cpp | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/extras/AudioPluginHost/Source/UI/PluginWindow.h b/extras/AudioPluginHost/Source/UI/PluginWindow.h index c533309bb6..991cc90452 100644 --- a/extras/AudioPluginHost/Source/UI/PluginWindow.h +++ b/extras/AudioPluginHost/Source/UI/PluginWindow.h @@ -146,6 +146,7 @@ public: activeWindowList (windowList), node (n), type (t) { + setResizable (true, false); setSize (400, 300); if (auto* ui = createProcessorEditor (*node->getProcessor(), type)) @@ -194,6 +195,16 @@ public: const AudioProcessorGraph::Node::Ptr node; const Type type; + BorderSize getBorderThickness() override + { + #if JUCE_IOS || JUCE_ANDROID + const int border = 10; + return { border, border, border, border }; + #else + return DocumentWindow::getBorderThickness(); + #endif + } + private: float getDesktopScaleFactor() const override { return 1.0f; } diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp index 21042d0b25..d42106ef2f 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp @@ -199,8 +199,6 @@ void LookAndFeel_V4::positionDocumentWindowButtons (DocumentWindow&, Button* closeButton, bool positionTitleBarButtonsOnLeft) { - titleBarH = jmin (titleBarH, titleBarH - titleBarY); - auto buttonW = static_cast (titleBarH * 1.2); auto x = positionTitleBarButtonsOnLeft ? titleBarX