From b2766207bed809ef9be8d6fdcace2035e0b64b9f Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 15 Jun 2016 18:53:26 +0200 Subject: load accountswitch as kubecomponent plugin --- components/mail/contents/ui/main.qml | 125 +-------------------- components/package/contents/ui/AccountSwitcher.qml | 2 + 2 files changed, 3 insertions(+), 124 deletions(-) (limited to 'components') diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 4d60e71b..12815e6d 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -139,131 +139,8 @@ ApplicationWindow { height: parent.height width: folderListView.width - 5 //to adjust for the toolbar spacing - 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" - } - } - } - } - } + KubeComponents.AccountSwitcher { } - - /* - * - */ } //END Folderlist section diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index 67c34792..9efbc637 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml @@ -19,6 +19,8 @@ import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 +import org.kde.kirigami 1.0 as Kirigami + import org.kube.framework.domain 1.0 as KubeFramework /* -- cgit v1.2.3