From 4990a02240077f2bd1ceb7a3cfcd76f651955684 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 15:30:00 +0100 Subject: improved settings ui --- components/package/contents/ui/Settings.qml | 64 ++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 14 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/Settings.qml b/components/package/contents/ui/Settings.qml index 8da372e7..164512ea 100644 --- a/components/package/contents/ui/Settings.qml +++ b/components/package/contents/ui/Settings.qml @@ -20,6 +20,7 @@ import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 2.0 as PlasmaComponents import org.kube.framework.settings 1.0 as KubeSettings import org.kube.framework.domain 1.0 as KubeFramework @@ -64,33 +65,65 @@ Rectangle { id: accountsController } - ColumnLayout { - spacing: 5 - Repeater { + SplitView { + anchors.fill: parent + + ListView { + id: accountsList + + width: Unit.size * 55 + Layout.maximumWidth: Unit.size * 150 + Layout.minimumWidth: Unit.size * 30 + model: accountsController.accounts - delegate: ColumnLayout { - height: 100 - width: 100 + + delegate: PlasmaComponents.ListItem { + width: accountsList.width + + height: Unit.size * 10 + + enabled: true + checked: accountsList.currentIndex == index + KubeFramework.AccountFactory { id: accountFactory accountId: modelData } - PlasmaCore.IconItem { + + MouseArea { anchors { - verticalCenter: parent.verticalCenter - left: parent.left - // leftMargin: Unit.size * 3 + fill: parent + } + + onClicked: { + accountDetails.source = accountFactory.uiPath + + accountsList.currentIndex = model.index } - source: accountFactory.icon } - Label { - text: accountFactory.name + + RowLayout { + anchors.fill: parent + + PlasmaCore.IconItem { + source: accountFactory.icon + } + + Label { + text: accountFactory.name + } } - // Loader { source: accountFactory.uiPath } } } + + Loader { + id: accountDetails + + Layout.fillWidth: true + } } + /* Button { id: button text: "Create New" @@ -100,5 +133,8 @@ Rectangle { } //TODO: Add possibility to add more accounts + + */ } + } -- cgit v1.2.3