From 6d2b4f84b0efdb6b1d6c207ed2ab6fc06c140ab8 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 15 Jun 2016 18:32:54 +0200 Subject: add add account / sync / edit account buttons --- components/mail/contents/ui/main.qml | 78 ++++++++----- components/package/contents/ui/AccountSwitcher.qml | 129 ++++++++++++++++++++- 2 files changed, 178 insertions(+), 29 deletions(-) diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 7b318991..4d60e71b 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -157,21 +157,65 @@ ApplicationWindow { width: 600 color: "lightgrey" //FIXME create a propper dialog thingy - clip: true + Item { + id: footer + + anchors { + bottom: parent.bottom + left: parent.left + right: parent.right + margins: Kirigami.Units.largeSpacing + } + + height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1 + width: listView.width + + Button { + + anchors { + verticalCenter: parent.verticalCenter + right: parent.right + } + + text: "Create new Account" + } + + Button { + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + } + + iconName: "view-refresh" + text: "Sync" + enabled: syncAction.ready + + onClicked: { + syncAction.execute() + } + } + } + ListView { id: listView - anchors.fill: parent - - footer: Button { - text: "Create new Account" + anchors { + top: parent.top + bottom: footer.top + left: parent.left + right: parent.right } + clip: true + model: KubeFramework.AccountsModel { } delegate: Kirigami.AbstractListItem { + id: accountDelegate + enabled: true supportsMouseEvents: true @@ -200,8 +244,6 @@ ApplicationWindow { Label { text: model.name === "" ? accountFactory.name : model.name } - - } Button { @@ -210,34 +252,18 @@ ApplicationWindow { margins: Kirigami.Units.largeSpacing } - + visible: accountDelegate.containsMouse text: "edit" } } } } - } - } /* - * KubeComponents.AccountSwitcher { - * Layout.fillHeight: true - * Layout.fillWidth: true - } - - - ToolButton { - iconName: "view-refresh" - text: "Sync" - enabled: syncAction.ready - - onClicked: { - syncAction.execute() - } - } - */ + * + */ } //END Folderlist section diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index 0e620854..67c34792 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml @@ -21,7 +21,130 @@ import QtQuick.Layouts 1.1 import org.kube.framework.domain 1.0 as KubeFramework -ComboBox { - model: KubeFramework.AccountsModel { } - textRole: "name" +/* + C omboBox { ** * + model: KubeFramework.AccountsModel { } + textRole: "name" + } */ + +Button { + id: accountSwitcher + + Layout.fillWidth: true + Layout.fillHeight: true + + text: "Account Switcher" + + Rectangle { + anchors { + top: parent.bottom + left: parent.left + } + + height: 300 + width: 600 + + color: "lightgrey" //FIXME create a propper dialog thingy + clip: true + + Item { + id: footer + + anchors { + bottom: parent.bottom + left: parent.left + right: parent.right + margins: Kirigami.Units.largeSpacing + } + + height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1 + width: listView.width + + Button { + + anchors { + verticalCenter: parent.verticalCenter + right: parent.right + } + + text: "Create new Account" + } + + Button { + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + } + + iconName: "view-refresh" + text: "Sync" + enabled: syncAction.ready + + onClicked: { + syncAction.execute() + } + } + } + + ListView { + id: listView + + anchors { + top: parent.top + bottom: footer.top + left: parent.left + right: parent.right + } + + clip: true + + model: KubeFramework.AccountsModel { } + + delegate: Kirigami.AbstractListItem { + id: accountDelegate + + enabled: true + supportsMouseEvents: true + + contentItem: Item { + height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1 + width: listView.width + + RowLayout { + anchors { + left: parent.left + margins: Kirigami.Units.smallSpacing + } + + Layout.fillHeight: true + + + KubeFramework.AccountFactory { + id: accountFactory + accountId: model.accountId + } + + Kirigami.Icon { + source: accountFactory.icon + } + + Label { + text: model.name === "" ? accountFactory.name : model.name + } + } + Button { + + anchors { + right: parent.right + margins: Kirigami.Units.largeSpacing + } + + visible: accountDelegate.containsMouse + text: "edit" + } + } + } + } + } } \ No newline at end of file -- cgit v1.2.3