Added resizable UI

This commit is contained in:
Roland Rabien 2023-09-01 20:23:08 -07:00
commit 9d6da9bb2d
4 changed files with 18 additions and 2 deletions

View file

@ -2,6 +2,7 @@
- Fixed pan when unison enabled
- Fixed preset overwrite dialog not showing
- Added resizable UI
0.0.2:

@ -1 +1 @@
Subproject commit abaff906847b3dbc009f34e5d6deabbe51229c34
Subproject commit 6844a00aaceb7555f0dd1e71bd25a22b6dfae235

View file

@ -68,4 +68,19 @@ void WavetableAudioProcessorEditor::addMenuItems (juce::PopupMenu& m)
{
vaProc.globalParams.mpe->setUserValue (vaProc.globalParams.mpe->getUserValueBool() ? 0.0f : 1.0f);
});
auto setSize = [this] (float scale)
{
if (auto p = findParentComponentOfClass<gin::ScaledPluginEditor>())
p->setScale (scale);
};
juce::PopupMenu um;
um.addItem ("50%", [setSize] { setSize (0.50f); });
um.addItem ("75%", [setSize] { setSize (0.75f); });
um.addItem ("100%", [setSize] { setSize (1.00f); });
um.addItem ("150%", [setSize] { setSize (1.50f); });
um.addItem ("200%", [setSize] { setSize (2.00f); });
m.addSubMenu ("UI Size", um);
}

View file

@ -932,7 +932,7 @@ bool WavetableAudioProcessor::hasEditor() const
juce::AudioProcessorEditor* WavetableAudioProcessor::createEditor()
{
return new WavetableAudioProcessorEditor (*this);
return new gin::ScaledPluginEditor (new WavetableAudioProcessorEditor (*this), state);
}
//==============================================================================