diff --git a/distrho/DistrhoUI.hpp b/distrho/DistrhoUI.hpp index 2832db0b..ef75f6c0 100644 --- a/distrho/DistrhoUI.hpp +++ b/distrho/DistrhoUI.hpp @@ -47,7 +47,7 @@ public: UI class constructor. The UI should be initialized to a default state that matches the plugin side. */ - UI(); + UI(uint width = 0, uint height = 0); /** Destructor. diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp index 49e8c3e6..4e977300 100644 --- a/distrho/src/DistrhoUI.cpp +++ b/distrho/src/DistrhoUI.cpp @@ -28,11 +28,14 @@ Window* d_lastUiWindow = nullptr; /* ------------------------------------------------------------------------------------------------------------ * UI */ -UI::UI() +UI::UI(uint width, uint height) : UIWidget(*d_lastUiWindow), pData(new PrivateData()) { UIWidget::setNeedsFullViewport(true); + + if (width > 0 && height > 0) + setSize(width, height); } UI::~UI()