From bd001d8b69846c8a7e5e82df899afa0d9c76172d Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Fri, 21 Apr 2017 17:26:21 +0200 Subject: remove toolbar and move enable the buttons in the mailListDelegate --- framework/qml/MailListView.qml | 112 ++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 75 deletions(-) (limited to 'framework/qml') diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index a662f5c8..96e266bb 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml @@ -66,71 +66,6 @@ Item { onActivated: root.currentIndex-- } - ToolBar { - id: toolbar - - width: parent.width - - Row { - anchors.centerIn: parent - - spacing: Kube.Units.smallSpacing - - Controls.ToolButton { - iconName: Kube.Icons.markAsRead - text: qsTr("Mark As Read") - tooltip: text - enabled: mailController.markAsReadAction.enabled - visible: enabled - onClicked: { - mailController.markAsReadAction.execute() - } - } - - Controls.ToolButton { - iconName: Kube.Icons.markAsUnread - text: qsTr("Mark As Unread") - tooltip: text - enabled: mailController.markAsUnreadAction.enabled - visible: enabled - onClicked: { - mailController.markAsUnreadAction.execute() - } - } - - Controls.ToolButton { - iconName: Kube.Icons.markImportant - text: qsTr("Toggle Important") - tooltip: text - enabled: mailController.toggleImportantAction.enabled - onClicked: { - mailController.toggleImportantAction.execute() - } - } - - Controls.ToolButton { - iconName: Kube.Icons.moveToTrash - text: qsTr("Delete Mail") - tooltip: text - enabled: mailController.moveToTrashAction.enabled - onClicked: { - mailController.moveToTrashAction.execute() - } - } - - Controls.ToolButton { - iconName: Kube.Icons.undo - text: qsTr("Restore Mail") - tooltip: text - enabled: mailController.restoreFromTrashAction.enabled - visible: enabled - onClicked: { - mailController.restoreFromTrashAction.execute() - } - } - } - } - Kube.Label { anchors.centerIn: parent visible: listView.count === 0 @@ -141,11 +76,7 @@ Item { ListView { id: listView - anchors.top: toolbar.bottom - - width: parent.width - height: parent.height - toolbar.height - + anchors.fill: parent focus: true clip: true @@ -227,9 +158,8 @@ Item { PropertyChanges {target: background; color: Kube.Colors.highlightColor; opacity: 0.6} PropertyChanges {target: subject; color: Kube.Colors.highlightedTextColor} PropertyChanges {target: sender; color: Kube.Colors.highlightedTextColor} - PropertyChanges {target: date; visible: false} + PropertyChanges {target: date; color: Kube.Colors.highlightedTextColor} PropertyChanges {target: threadCounter; color: Kube.Colors.highlightedTextColor} - PropertyChanges {target: buttons; visible: true} } ] @@ -331,7 +261,7 @@ Item { Row { id: buttons - property bool containsMouse: importantButton.hovered || deleteButton.hovered || unreadButton.hovered + property bool containsMouse: importantButton.hovered || deleteButton.hovered || unreadButton.hovered || readButton.hovered anchors { right: parent.right @@ -343,21 +273,53 @@ Item { spacing: Kube.Units.smallSpacing opacity: 0.7 + Kube.Button { + id: readButton + text: "r" + enabled: mailController.markAsReadAction.enabled + visible: enabled + onClicked: { + mailController.markAsReadAction.execute() + } + } Kube.Button { id: unreadButton - text: "u" + enabled: mailController.markAsUnreadAction.enabled + visible: enabled + onClicked: { + mailController.markAsUnreadAction.execute() + } } Kube.Button { id: importantButton - text: "i" + enabled: mailController.toggleImportantAction.enabled + visible: enabled + onClicked: { + mailController.toggleImportantAction.execute() + } } Kube.Button { id: deleteButton text: "d" + enabled: mailController.moveToTrashAction.enabled + visible: enabled + onClicked: { + mailController.moveToTrashAction.execute() + } + } + + Kube.Button { + id: restoreButton + text: "re" + enabled: mailController.restoreFromTrashAction.enabled + visible: enabled + onClicked: { + mailController.restoreFromTrashAction.execute() + } } } } -- cgit v1.2.3