From a5f38b6541fbab0bdf31d5a804ec644af09a6b1b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 10 Jan 2018 12:27:56 +0100 Subject: The Inbox crusher as a first experimental view. The extension itself is not really usable yet, but serves as a showcase. --- views/inboxcrusher/qml/View.qml | 102 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 views/inboxcrusher/qml/View.qml (limited to 'views/inboxcrusher/qml') diff --git a/views/inboxcrusher/qml/View.qml b/views/inboxcrusher/qml/View.qml new file mode 100644 index 00000000..7059a8eb --- /dev/null +++ b/views/inboxcrusher/qml/View.qml @@ -0,0 +1,102 @@ +/* + * 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.4 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 +import org.kube.framework 1.0 as Kube + +FocusScope { + id: root + property variant currentMail: null + + Keys.onRightPressed: { + modelIndexRetriever.currentIndex = modelIndexRetriever.currentIndex + 1 + } + Keys.onLeftPressed: { + if (modelIndexRetriever.currentIndex > 0) { + modelIndexRetriever.currentIndex = modelIndexRetriever.currentIndex - 1 + } + } + Kube.ModelIndexRetriever { + id: modelIndexRetriever + model: Kube.MailListModel { + showInbox: true + } + currentIndex: 0 + onCurrentDataChanged: { + root.currentMail = currentData.mail + } + } + Column { + anchors.fill: parent + spacing: Kube.Units.smallSpacing + Repeater { + anchors { + left: parent.left + right: parent.right + } + model: Kube.MailListModel { + mail: root.currentMail + } + Kube.MailViewer { + anchors { + left: parent.left + right: parent.right + } + message: model.mimeMessage + subject: model.subject + sender: model.sender + senderName: model.senderName + to: model.to + cc: model.cc + bcc: model.bcc + date: model.date + unread: model.unread + trash: model.trash + draft: model.draft + sent: model.sent + incomplete: model.incomplete + current: true + } + } + Row { + spacing: Kube.Units.smallSpacing + anchors { + horizontalCenter: parent.horizontalCenter + } + height: Kube.Units.gridUnit + Kube.Button { + focus: true + text: qsTr("Delete!") + onClicked: { + } + } + Kube.Button { + text: qsTr("Reply!") + onClicked: { + } + } + Kube.Button { + text: qsTr("Flag!") + onClicked: { + } + } + } + } +} -- cgit v1.2.3