From ebe946c66ce8a251ac98583dbebe33a75eab5480 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 9 Jan 2017 16:38:55 +0100 Subject: remove app toolbar and move toolbuttons into the columns --- components/package/contents/ui/AccountSwitcher.qml | 7 +-- components/package/contents/ui/MailListView.qml | 61 +++++++++++++++++++++- 2 files changed, 61 insertions(+), 7 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index 16e84931..6d1c0aa2 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml @@ -38,9 +38,6 @@ Controls2.Button { id: folderController } - Layout.fillWidth: true - height: parent.height - text: "Accounts" onClicked: { @@ -54,8 +51,8 @@ Controls2.Button { height: 300 width: 600 - x: parent.x - y: parent.y + parent.height + x: 0 + y: - popup.height modal: true focus: true diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index cb0bd4bf..68db1c43 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml @@ -18,6 +18,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import QtQuick.Controls 1.4 as Controls import QtQuick.Layouts 1.1 import QtQml 2.2 as QtQml @@ -36,12 +37,68 @@ Item { currentMail = null } - ListView { + ToolBar { + id: toolbar + + width: parent.width + + Row { + anchors.centerIn: parent + + spacing: Kirigami.Units.smallSpacing + + Controls.ToolButton { + iconName: "mail-mark-unread" + text: qsTr("Mark As Read") + enabled: mailController.markAsReadAction.enabled + tooltip: qsTr("mark mail as read") + onClicked: { + mailController.markAsReadAction.execute() + } + } + + Controls.ToolButton { + iconName: "mail-mark-important" + text: qsTr("Mark Important") + enabled: mailController.markAsImportantAction.enabled + tooltip: qsTr("mark mail as important") + onClicked: { + mailController.markAsImportantAction.execute() + } + } + + Controls.ToolButton { + iconName: "edit-delete" + text: qsTr("Delete Mail") + enabled: mailController.moveToTrashAction.enabled + tooltip: qsTr("delete email") + onClicked: { + mailController.moveToTrashAction.execute() + } + } + + Controls.ToolButton { + iconName: "edit-undo" + text: qsTr("Restore Mail") + enabled: mailController.restoreFromTrashAction.enabled + tooltip: qsTr("restore email") + onClicked: { + mailController.restoreFromTrashAction.execute() + } + } + } + } + + ListView { id: listView - anchors.fill: parent + anchors.top: toolbar.bottom + + width: parent.width + height: parent.height - toolbar.height focus: true + clip: true ScrollBar.vertical: ScrollBar{ id: scrollbar -- cgit v1.2.3