sync dialog size

This commit is contained in:
Marco Martin 2013-03-07 11:50:22 +01:00
parent a4b22cc7d4
commit 4a5648edbc
2 changed files with 14 additions and 7 deletions

View File

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

View File

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