aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv_qt4.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-20 04:11:24 +0000
committerDavid Robillard <d@drobilla.net>2011-10-20 04:11:24 +0000
commitc9321a790de52835588989ac6c032a44c5eed668 (patch)
treef938a95beca8f64fb2f0c8ce5166f547337b8bbc /src/jalv_qt4.cpp
parentc059e981b4d563edfb19a73e48b79efab34eee86 (diff)
downloadjalv-c9321a790de52835588989ac6c032a44c5eed668.tar.gz
jalv-c9321a790de52835588989ac6c032a44c5eed668.tar.bz2
jalv-c9321a790de52835588989ac6c032a44c5eed668.zip
Support UI resize extension.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3552 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv_qt4.cpp')
-rw-r--r--src/jalv_qt4.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/jalv_qt4.cpp b/src/jalv_qt4.cpp
index 7673165..a765770 100644
--- a/src/jalv_qt4.cpp
+++ b/src/jalv_qt4.cpp
@@ -39,6 +39,18 @@ jalv_native_ui_type(Jalv* jalv)
"http://lv2plug.in/ns/extensions/ui#Qt4UI");
}
+int
+jalv_ui_resize(Jalv* jalv, int width, int height)
+{
+ if (jalv->ui_instance && width > 0 && height > 0) {
+ QWidget* widget = (QWidget*)suil_instance_get_widget(jalv->ui_instance);
+ if (widget) {
+ widget->resize(width, height);
+ }
+ }
+ return 0;
+}
+
class Timer : public QTimer {
public:
Timer(Jalv* j) : jalv(j) {}
@@ -58,6 +70,7 @@ jalv_open_ui(Jalv* jalv,
if (instance) {
QWidget* widget = (QWidget*)suil_instance_get_widget(instance);
widget->show();
+ jalv_ui_resize(jalv, jalv->ui_width, jalv->ui_height);
} else {
QPushButton* button = new QPushButton("Close");
button->show();