From 8bc60f6b3fb54f844a026d505bf3f4070503f95d Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 3 May 2017 18:57:32 +0200 Subject: add initial inline accountsView --- components/kube/contents/ui/AccountsView.qml | 119 +++++++++++++++++++++++++++ components/kube/contents/ui/Kube.qml | 14 +++- 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 components/kube/contents/ui/AccountsView.qml (limited to 'components') diff --git a/components/kube/contents/ui/AccountsView.qml b/components/kube/contents/ui/AccountsView.qml new file mode 100644 index 00000000..6ab8387b --- /dev/null +++ b/components/kube/contents/ui/AccountsView.qml @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.4 +import QtQuick.Layouts 1.1 + +import org.kube.framework 1.0 as Kube + +Rectangle { + id: app + + height: 800 + width: 1400 + + color: Kube.Colors.backgroundColor + + RowLayout { + + anchors.fill: parent + + Item { + id: accountList + width: 300 + Layout.fillHeight: true + + Kube.PositiveButton { + id: newAccountButton + anchors { + top: parent.top + left: parent.left + right: parent.right + margins: Kube.Units.largeSpacing + } + text: "New Account" + } + + ListView { + id: listView + + anchors { + top: newAccountButton.bottom + left: parent.left + right: parent.right + bottom: parent.bottom + topMargin: Kube.Units.largeSpacing + } + + clip: true + + model: Kube.AccountsModel {} + + delegate: Rectangle { + height: Kube.Units.gridUnit * 3 + width: listView.width + + border.color: Kube.Colors.buttonColor + border.width: 1 + color: Kube.Colors.viewBackgroundColor + + Kube.Label { + anchors.centerIn: parent + text: model.name + } + + MouseArea { + id: mouseArea + anchors.fill: parent + + onClicked: { + console.log("clicked account \"" + model.accountId + "\"" ) + //editAccountComponent.createObject(app, {accountId:model.accountId}) + edit.accountId = model.accountId + } + } + } + } + } + + Rectangle { + height: parent.height + width: 1 + color: Kube.Colors.buttonColor + } + + Item { + + height: parent.height + width: 200 + Layout.fillWidth: true + + Kube.EditAccount { + id: edit + + anchors { + top: parent.top + left: parent.left + right: parent.right + bottom: parent.bottom + margins: Kube.Units.largeSpacing + } + } + } + } +} diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index b5eee31f..18c1b6ec 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml @@ -152,7 +152,10 @@ Controls2.ApplicationWindow { width: height } - Kube.AccountSwitcher {} + Kube.IconButton { + iconName: Kube.Icons.menu_inverted + onClicked: kubeViews.setAccountsView() + } } } StackView { @@ -173,6 +176,10 @@ Controls2.ApplicationWindow { //TODO replacing here while a composer is open is destructive kubeViews.push({item: mailView, replace: true, immediate: true}) } + function setAccountsView() { + kubeViews.push({item: accountsView, replace: true, immediate: true}) + } + function openComposer() { kubeViews.push({item: composerView, immediate: true}) } @@ -193,6 +200,11 @@ Controls2.ApplicationWindow { onDone: kubeViews.pop({immediate: true}) } } + Component { + id: accountsView + AccountsView { + } + } } } //END Main content -- cgit v1.2.3