fix layout

This commit is contained in:
Marco Martin 2013-08-12 18:40:18 +02:00
parent 72485975cb
commit bd82f72a40
2 changed files with 28 additions and 18 deletions

View File

@ -97,7 +97,7 @@ Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredHeight: parent.height - buttonsRow.height Layout.preferredHeight: parent.height - buttonsRow.height
QtControls.ScrollView{ QtControls.ScrollView {
id: categoriesScroll id: categoriesScroll
frameVisible: true frameVisible: true
anchors { anchors {
@ -151,7 +151,7 @@ Rectangle {
} }
} }
} }
QtControls.ScrollView{ QtControls.ScrollView {
id: pageScroll id: pageScroll
anchors { anchors {
top: parent.top top: parent.top
@ -166,7 +166,11 @@ Rectangle {
height: childrenRect.height height: childrenRect.height
QtControls.StackView { QtControls.StackView {
id: main id: main
anchors.fill: parent anchors {
left: parent.left
right: parent.right
}
height: Math.max(pageScroll.height, currentItem.implicitHeight)
anchors.margins: 12 anchors.margins: 12
property string sourceFile property string sourceFile
Timer { Timer {
@ -204,7 +208,7 @@ Rectangle {
rightMargin: spacing rightMargin: spacing
} }
QtControls.Button { QtControls.Button {
iconSource: "dialog-ok" iconName: "dialog-ok"
text: "Ok" text: "Ok"
onClicked: { onClicked: {
if (main.currentItem.saveConfig !== undefined) { if (main.currentItem.saveConfig !== undefined) {
@ -216,7 +220,7 @@ Rectangle {
} }
} }
QtControls.Button { QtControls.Button {
iconSource: "dialog-ok-apply" iconName: "dialog-ok-apply"
text: "Apply" text: "Apply"
onClicked: { onClicked: {
if (main.currentItem.saveConfig !== undefined) { if (main.currentItem.saveConfig !== undefined) {
@ -227,7 +231,7 @@ Rectangle {
} }
} }
QtControls.Button { QtControls.Button {
iconSource: "dialog-cancel" iconName: "dialog-cancel"
text: "Cancel" text: "Cancel"
onClicked: configDialog.close() onClicked: configDialog.close()
} }

View File

@ -17,12 +17,12 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.configuration 2.0 import org.kde.plasma.configuration 2.0
import QtQuick.Controls 1.0 as QtControls import QtQuick.Controls 1.0 as QtControls
import QtQuick.Layouts 1.0
Column { ColumnLayout {
id: root id: root
spacing: _m spacing: _m
@ -30,7 +30,6 @@ Column {
text: "Plugins" text: "Plugins"
} }
//BEGIN functions //BEGIN functions
function saveConfig() { function saveConfig() {
for (var key in configDialog.wallpaperConfiguration) { for (var key in configDialog.wallpaperConfiguration) {
@ -109,25 +108,32 @@ Column {
} }
} }
} }
PlasmaComponents.PageStack {
Row {
spacing: 10
QtControls.Label {
anchors.verticalCenter: pluginCombobox.verticalCenter
text: "Wallpaper plugin:"
}
QtControls.ComboBox {
id: pluginCombobox
model: configDialog.wallpaperConfigModel
textRole: "name"
}
}
QtControls.StackView {
id: main id: main
Layout.fillHeight: true;
anchors { anchors {
left: categoriesView.left; left: categoriesView.left;
right: parent.right; right: parent.right;
} }
width: implicitWidth
height: implicitHeight
property string sourceFile property string sourceFile
onSourceFileChanged: { onSourceFileChanged: {
if (sourceFile != "") { if (sourceFile != "") {
main.opacity = 1;
replace(Qt.resolvedUrl(sourceFile)) replace(Qt.resolvedUrl(sourceFile))
//main.width = mainColumn.implicitWidth
main.height = mainColumn.implicitHeight
} else {
main.opacity = 0
} }
} }
Behavior on opacity { NumberAnimation {} }
} }
} }