From a22193f9bae2ac171a2c106793fc25d6ebc316df Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 15:41:11 +0100 Subject: add scrollview to the accountslist --- components/package/contents/ui/Settings.qml | 62 ++++++++++++++++------------- 1 file changed, 34 insertions(+), 28 deletions(-) (limited to 'components/package/contents') diff --git a/components/package/contents/ui/Settings.qml b/components/package/contents/ui/Settings.qml index 164512ea..f6a03945 100644 --- a/components/package/contents/ui/Settings.qml +++ b/components/package/contents/ui/Settings.qml @@ -68,49 +68,55 @@ Rectangle { SplitView { anchors.fill: parent - ListView { + ScrollView { id: accountsList - width: Unit.size * 55 - Layout.maximumWidth: Unit.size * 150 - Layout.minimumWidth: Unit.size * 30 + width: Unit.size * 55 + Layout.maximumWidth: Unit.size * 150 + Layout.minimumWidth: Unit.size * 30 - model: accountsController.accounts + ListView { + id: listView - delegate: PlasmaComponents.ListItem { - width: accountsList.width + model: accountsController.accounts - height: Unit.size * 10 + currentIndex: -1 - enabled: true - checked: accountsList.currentIndex == index + delegate: PlasmaComponents.ListItem { - KubeFramework.AccountFactory { - id: accountFactory - accountId: modelData - } + width: listView.width + height: Unit.size * 10 + + enabled: true + checked: listView.currentIndex == index - MouseArea { - anchors { - fill: parent + KubeFramework.AccountFactory { + id: accountFactory + accountId: modelData } - onClicked: { - accountDetails.source = accountFactory.uiPath + MouseArea { + anchors { + fill: parent + } + + onClicked: { + accountDetails.source = accountFactory.uiPath - accountsList.currentIndex = model.index + listView.currentIndex = model.index + } } - } - RowLayout { - anchors.fill: parent + RowLayout { + anchors.fill: parent - PlasmaCore.IconItem { - source: accountFactory.icon - } + PlasmaCore.IconItem { + source: accountFactory.icon + } - Label { - text: accountFactory.name + Label { + text: accountFactory.name + } } } } -- cgit v1.2.3