From 6d726bb10386b3d7f5481d41b735ec06cb2163ad Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 9 Jan 2018 09:35:59 +0100 Subject: Install composer/converations/people as separate views and load them dynamically. --- views/conversation/metadata.json | 4 + views/conversation/qml/View.qml | 120 ++++++++++++++++++++++ views/conversation/tests/tst_conversationview.qml | 37 +++++++ 3 files changed, 161 insertions(+) create mode 100644 views/conversation/metadata.json create mode 100644 views/conversation/qml/View.qml create mode 100644 views/conversation/tests/tst_conversationview.qml (limited to 'views/conversation') diff --git a/views/conversation/metadata.json b/views/conversation/metadata.json new file mode 100644 index 00000000..870ff2aa --- /dev/null +++ b/views/conversation/metadata.json @@ -0,0 +1,4 @@ +{ + "icon": "mail-message-inverted", + "tooltip": "Follow conversations." +} diff --git a/views/conversation/qml/View.qml b/views/conversation/qml/View.qml new file mode 100644 index 00000000..8b2b0caf --- /dev/null +++ b/views/conversation/qml/View.qml @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * Copyright (C) 2017 Christian Mollekopf, + * + * 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.7 +import QtQuick.Controls 1.3 +import QtQuick.Controls 2.0 as Controls2 +import QtQuick.Layouts 1.1 + +import org.kube.framework 1.0 as Kube + +FocusScope { + SplitView { + anchors.fill: parent + Rectangle { + width: Kube.Units.gridUnit * 10 + Layout.fillHeight: parent.height + color: Kube.Colors.textColor + + Kube.PositiveButton { + id: newMailButton + + anchors { + top: parent.top + left: parent.left + right: parent.right + margins: Kube.Units.largeSpacing + } + focus: true + text: qsTr("New Email") + onClicked: Kube.Fabric.postMessage(Kube.Messages.compose, {}) + } + + Kube.InlineAccountSwitcher { + id: accountFolderview + activeFocusOnTab: true + anchors { + top: newMailButton.bottom + topMargin: Kube.Units.largeSpacing + bottom: statusBarContainer.top + left: newMailButton.left + right: parent.right + } + } + + Item { + id: statusBarContainer + anchors { + topMargin: Kube.Units.smallSpacing + bottom: parent.bottom + left: parent.left + right: parent.right + } + height: childrenRect.height + + Rectangle { + id: border + visible: statusBar.visible + anchors { + right: parent.right + left: parent.left + margins: Kube.Units.smallSpacing + } + height: 1 + color: Kube.Colors.viewBackgroundColor + opacity: 0.3 + } + Kube.StatusBar { + id: statusBar + accountId: accountFolderview.currentAccount + height: Kube.Units.gridUnit * 2 + anchors { + top: border.bottom + left: statusBarContainer.left + right: statusBarContainer.right + } + } + } + } + + Rectangle { + width: Kube.Units.gridUnit * 18 + Layout.fillHeight: parent.height + + color: "transparent" + border.width: 1 + border.color: Kube.Colors.buttonColor + + Kube.MailListView { + id: mailListView + anchors.fill: parent + activeFocusOnTab: true + Layout.minimumWidth: Kube.Units.gridUnit * 10 + } + } + + Kube.ConversationView { + id: mailView + Layout.fillWidth: true + Layout.fillHeight: parent.height + activeFocusOnTab: true + } + } +} diff --git a/views/conversation/tests/tst_conversationview.qml b/views/conversation/tests/tst_conversationview.qml new file mode 100644 index 00000000..467c049a --- /dev/null +++ b/views/conversation/tests/tst_conversationview.qml @@ -0,0 +1,37 @@ +/* + * Copyright 2017 Christian Mollekopf + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, 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 Library General Public License for more details + * + * You should have received a copy of the GNU Library 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.7 +import QtTest 1.0 +import "../qml" + +TestCase { + id: testCase + width: 400 + height: 400 + name: "MailView" + + View { + id: mailView + } + + function test_start() { + verify(mailView) + } +} -- cgit v1.2.3