From 4a5648edbcc6852ff79e99ceacd88c7c4ab5aaa5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Mar 2013 11:50:22 +0100 Subject: [PATCH] sync dialog size --- .../desktop/contents/components/Configuration.qml | 12 ++++++++++-- .../ConfigurationContainmentAppearance.qml | 9 ++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/components/Configuration.qml b/src/shell/qmlpackages/desktop/contents/components/Configuration.qml index 94ae07038..edf9e0011 100644 --- a/src/shell/qmlpackages/desktop/contents/components/Configuration.qml +++ b/src/shell/qmlpackages/desktop/contents/components/Configuration.qml @@ -179,10 +179,18 @@ Rectangle { id: main anchors.fill: parent property string sourceFile + Timer { + id: pageSizeSync + interval: 100 + onTriggered: { + root.width = mainColumn.implicitWidth + root.height = mainColumn.implicitHeight + } + } + onImplicitWidthChanged: pageSizeSync.restart() + onImplicitHeightChanged: pageSizeSync.restart() onSourceFileChanged: { replace(Qt.resolvedUrl(sourceFile)) - root.width = mainColumn.implicitWidth - root.height = mainColumn.implicitHeight /* * This is not needed on a desktop shell that has ok/apply/cancel buttons, i'll leave it here only for future reference until we have a prototype for the active shell. * root.pageChanged will start a timer, that in turn will call saveConfig() when triggered diff --git a/src/shell/qmlpackages/desktop/contents/components/ConfigurationContainmentAppearance.qml b/src/shell/qmlpackages/desktop/contents/components/ConfigurationContainmentAppearance.qml index 0b1f4fb23..fb3c5a541 100644 --- a/src/shell/qmlpackages/desktop/contents/components/ConfigurationContainmentAppearance.qml +++ b/src/shell/qmlpackages/desktop/contents/components/ConfigurationContainmentAppearance.qml @@ -26,6 +26,7 @@ Column { text: "Plugins" } + //BEGIN functions function saveConfig() { for (var key in configDialog.wallpaperConfiguration) { @@ -76,11 +77,9 @@ Column { } PlasmaComponents.PageStack { id: main - anchors { - left: parent.left - right: parent.right - } - height: 200 + anchors.horizontalCenter: parent.horizontalCenter + width: implicitWidth + height: implicitHeight property string sourceFile onSourceFileChanged: { replace(Qt.resolvedUrl(sourceFile))