Browse Source

Allow to specify widget UI size during construction

gh-pages
falkTX 10 years ago
parent
commit
aa5925952c
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      distrho/DistrhoUI.hpp
  2. +4
    -1
      distrho/src/DistrhoUI.cpp

+ 1
- 1
distrho/DistrhoUI.hpp View File

@@ -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.


+ 4
- 1
distrho/src/DistrhoUI.cpp View File

@@ -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()


Loading…
Cancel
Save