diff --git a/src/scriptengines/qml/plasmoid/configview.cpp b/src/scriptengines/qml/plasmoid/configview.cpp index d63a3ff57..3e38d395f 100644 --- a/src/scriptengines/qml/plasmoid/configview.cpp +++ b/src/scriptengines/qml/plasmoid/configview.cpp @@ -42,7 +42,7 @@ ConfigView::ConfigView(AppletInterface *interface, QWindow *parent) qWarning() << "Invalid home screen package"; } - setResizeMode(QQuickView::SizeRootObjectToView); + setResizeMode(QQuickView::SizeViewToRootObject); QQmlComponent *component = new QQmlComponent(engine(), QUrl::fromLocalFile(m_appletInterface->applet()->package().filePath("ui", "config.qml")), this); @@ -76,4 +76,12 @@ void ConfigView::hideEvent(QHideEvent *ev) deleteLater(); } +void ConfigView::resizeEvent(QResizeEvent *re) +{ + rootObject()->setWidth(re->size().width()); + rootObject()->setHeight(re->size().height()); + QQuickWindow::resizeEvent(re); +} + + #include "moc_configview.cpp" diff --git a/src/scriptengines/qml/plasmoid/configview.h b/src/scriptengines/qml/plasmoid/configview.h index 8fcffca13..5b0ceb20e 100644 --- a/src/scriptengines/qml/plasmoid/configview.h +++ b/src/scriptengines/qml/plasmoid/configview.h @@ -40,6 +40,7 @@ public: protected: void hideEvent(QHideEvent *ev); + void resizeEvent(QResizeEvent *re); private: AppletInterface *m_appletInterface; diff --git a/src/shell/applets/testapplet/contents/ui/config.qml b/src/shell/applets/testapplet/contents/ui/config.qml index 523c786df..1d2743104 100644 --- a/src/shell/applets/testapplet/contents/ui/config.qml +++ b/src/shell/applets/testapplet/contents/ui/config.qml @@ -32,10 +32,13 @@ QtObject { id: iconsPage width: childrenRect.width height: childrenRect.height + implicitWidth: mainColumn.implicitWidth + implicitHeight: pageColumn.implicitHeight property alias cfg_Test: testConfigField.text Column { + id: pageColumn anchors.fill: parent spacing: 4 Row { diff --git a/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml b/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml index 8dd574083..e056c0110 100644 --- a/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml +++ b/src/shell/qmlpackages/desktop/contents/ui/Configuration.qml @@ -88,13 +88,20 @@ Rectangle { Column { id: mainColumn anchors.fill: parent + property int implicitWidth: Math.max(contentRow.implicitWidth, buttonsRow.implicitWidth) + 8 + property int implicitHeight: contentRow.implicitHeight + buttonsRow.implicitHeight + 8 + Row { + id: contentRow anchors { left: parent.left right: parent.right } spacing: 4 height: parent.height - buttonsRow.height + property int implicitWidth: categoriesScroll.implicitWidth + pageScroll.implicitWidth + property int implicitHeight: Math.max(categoriesScroll.implicitHeight, pageScroll.implicitHeight) + PlasmaExtras.ScrollArea { id: categoriesScroll anchors { @@ -103,6 +110,8 @@ Rectangle { } visible: configDialog.configPages.length > 0 && globalConfigPages.length > 0 width: visible ? 100 : 0 + implicitWidth: width + implicitHeight: theme.defaultFont.mSize.height * 12 Flickable { id: categoriesView contentWidth: width @@ -149,12 +158,15 @@ Rectangle { } } PlasmaExtras.ScrollArea { + id: pageScroll anchors { top: parent.top bottom: parent.bottom margins: 4 } width: parent.width - categoriesScroll.width - 8 + implicitWidth: main.currentPage ? main.currentPage.implicitWidth : 0 + implicitHeight: main.currentPage ? main.currentPage.implicitHeight : 0 Flickable { contentWidth: width contentHeight: main.height @@ -167,6 +179,8 @@ Rectangle { property Component sourceComponent onSourceComponentChanged: { replace(sourceComponent) + root.width = mainColumn.implicitWidth + root.height = mainColumn.implicitHeight } } }