From 2357e0a3cf8bf41a5e6bcd0c2214626cb9edb57a Mon Sep 17 00:00:00 2001 From: George Reales Date: Sat, 6 Jun 2020 19:55:01 +0200 Subject: [PATCH] iOS build fixes --- Source/PluginGui.cpp | 8 +++++++- Source/PluginGui.h | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp index 2eadd1e..d670fd7 100644 --- a/Source/PluginGui.cpp +++ b/Source/PluginGui.cpp @@ -2195,7 +2195,13 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) += " Demo" #endif , NotificationType::dontSendNotification); - + + // Change LookandFeelFree combobox + oplComboBoxLookAndFeel.reset(new OPLComboBoxLookAndFeelMethods()); + + for (auto comB : {frequencyComboBox.get(), frequencyComboBox2.get(), velocityComboBox.get(), velocityComboBox2.get(), keyscaleAttenuationComboBox2.get(), keyscaleAttenuationComboBox.get()}){ + comB->setLookAndFeel(oplComboBoxLookAndFeel.get()); + } //[/UserPreSize] setSize (860, 580); diff --git a/Source/PluginGui.h b/Source/PluginGui.h index 910de66..533a2f4 100644 --- a/Source/PluginGui.h +++ b/Source/PluginGui.h @@ -130,6 +130,24 @@ public: private: //[UserVariables] -- You can add your own custom variables in this section. + class OPLComboBoxLookAndFeelMethods: + public LookAndFeel_V3 + { + virtual PopupMenu::Options getOptionsForComboBoxPopupMenu (ComboBox& comBox, Label& label) override{ + PopupMenu::Options options = LookAndFeel_V3::getOptionsForComboBoxPopupMenu(comBox, label); + #if JUCE_IOS + if (PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_AudioUnitv3) + { + if (options.getTargetComponent() != nullptr) + return options.withParentComponent(options.getTargetComponent()->getTopLevelComponent()); + } + #endif + return options; + }; + }; + + std::unique_ptr oplComboBoxLookAndFeel; + static const uint32 COLOUR_MID = 0xff007f00; static const uint32 COLOUR_RECORDING = 0xffff0000; AdlibBlasterAudioProcessor* processor;