commit 61a5ffeaf42aa70d51b4cc55f767baf74c804d95
parent d4fc10ecf9fc96660d63fd21ae3c35ef958e8578
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Wed, 30 Oct 2024 23:12:41 +0100
display error if no skin can be loaded instead of opening a window of size 0,0
Diffstat:
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/source/jucePluginEditorLib/pluginProcessor.cpp b/source/jucePluginEditorLib/pluginProcessor.cpp
@@ -66,7 +66,31 @@ namespace jucePluginEditorLib
m_editorState->setPerInstanceConfig(m_editorStateData);
}
- return new EditorWindow(*this, *m_editorState, getConfig());
+ auto* window = new EditorWindow(*this, *m_editorState, getConfig());
+
+ if(window->getWidth() == 0 || window->getHeight() == 0)
+ {
+ constexpr int w = 600;
+ constexpr int h = 300;
+
+ window->setSize(w,h);
+
+ auto* l = new juce::Label({},
+ "No skins found, check your installation\n"
+ "\n"
+ "Skins need to be located at:\n"
+ "\n" +
+ m_editorState->getSkinFolder()
+ );
+
+ l->setSize(w,h);
+ l->setJustificationType(juce::Justification::centred);
+ l->setColour(juce::Label::ColourIds::textColourId, juce::Colour(0xffff0000));
+ l->setColour(juce::Label::ColourIds::backgroundColourId, juce::Colour(0xff111111));
+
+ window->addAndMakeVisible(l);
+ }
+ return window;
}
void Processor::destroyEditorState()