commit aa5925952ce757f2e81a50db062d37eb39552340
parent 053854daf007c4aeeda43c26de124181e6187cf2
Author: falkTX <falktx@gmail.com>
Date: Tue, 21 Apr 2015 11:11:49 +0200
Allow to specify widget UI size during construction
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git 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
@@ -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()