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/mail/contents/ui/main.qml | 213 +++++++++-------------------------- 1 file changed, 51 insertions(+), 162 deletions(-) (limited to 'components/mail/contents/ui') diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 252cac5b..20fa25c1 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -125,191 +125,82 @@ Controls2.ApplicationWindow { //BEGIN Main content SplitView { anchors { - top: toolbar.bottom + top: app.top left: app.left } - height: app.height - toolbar.height + height: app.height width: app.width - KubeComponents.FolderListView { - id: folderListView + Rectangle { width: Kirigami.Units.gridUnit * 10 Layout.maximumWidth: app.width * 0.25 Layout.minimumWidth: Kirigami.Units.gridUnit * 5 - focus: true - accountId: accountSwitcher.accountId - } - - KubeComponents.MailListView { - id: mailListView - parentFolder: folderListView.currentFolder - width: Kirigami.Units.gridUnit * 20 - height: parent.height - Layout.maximumWidth: app.width * 0.4 - Layout.minimumWidth: Kirigami.Units.gridUnit * 10 - focus: true - } - - KubeComponents.SingleMailView { - id: mailView - mail: mailListView.currentMail - Layout.fillWidth: true - } - } - //END Main content - - //BEGIN Toolbar - Controls2.ToolBar { - id: toolbar - - anchors { - top: app.top - } - - width: app.width - height: Kirigami.Units.iconSizes.medium + Kirigami.Units.smallSpacing * 2 - Row { - width: parent.width - height: parent.height - - spacing: 1 //to account for the SplitView borders + color: Kirigami.Theme.textColor - //BEGIN Folderlist section - RowLayout { - height: parent.height - width: folderListView.width - 5 //to adjust for the toolbar spacing + Controls2.Button { + id: newMailButton - KubeComponents.AccountSwitcher { - id: accountSwitcher - } - } - //END Folderlist section - - //BEGIN MailList section - Item { - - height: parent.height - width: mailListView.width - - Row { - anchors.centerIn: parent - - spacing: Kirigami.Units.smallSpacing - - ToolButton { - iconName: "mail-mark-unread" - text: qsTr("Mark As Read") - enabled: mailController.markAsReadAction.enabled - tooltip: qsTr("mark mail as read") - onClicked: { - mailController.markAsReadAction.execute() - } - } - - ToolButton { - iconName: "mail-mark-important" - text: qsTr("Mark Important") - enabled: mailController.markAsImportantAction.enabled - tooltip: qsTr("mark mail as important") - onClicked: { - mailController.markAsImportantAction.execute() - } - } - - ToolButton { - iconName: "edit-delete" - text: qsTr("Delete Mail") - enabled: mailController.moveToTrashAction.enabled - tooltip: qsTr("delete email") - onClicked: { - mailController.moveToTrashAction.execute() - } - } - - ToolButton { - iconName: "edit-undo" - text: qsTr("Restore Mail") - enabled: mailController.restoreFromTrashAction.enabled - tooltip: qsTr("restore email") - onClicked: { - mailController.restoreFromTrashAction.execute() - } - } + anchors { + top: parent.top + left: parent.left + right: parent.right + margins: Kirigami.Units.smallSpacing } - } - //END MailList section - //BEGIN MailView sections - RowLayout{ + height: Kirigami.Units.gridUnit * 1.5 - height: parent.height - width: mailView.width + text: " " + qsTr("New Email") + " " + //iconName: "mail-message-new" + //Controls2.Tooltip.text: "compose new email" - Item { - width: Kirigami.Units.smallSpacing - height: width + onClicked: { + composer.open() } + } - Controls2.Button { - id: newMailButton - - - height: toolbar.height - - //iconName: "mail-message-new" - text: " " + qsTr("New Email") + " " - //Controls2.Tooltip.text: "compose new email" - onClicked: { - composer.open() - } - } + KubeComponents.FolderListView { + id: folderListView - KubeComponents.Outbox { - } -/* - ToolButton { - iconName: "mail-message-reply" - text: "Reply" - enabled: replyAction.ready - onClicked: { - replyAction.execute() - } + anchors { + top: newMailButton.bottom + bottom: accountSwitcher.top + left: parent.left + right: parent.right + topMargin: Kirigami.Units.smallSpacing } - - * ToolButton { - * iconName: "mail-message-edit" - * text: "Edit" - * enabled: editAction.ready - * onClicked: { - * editAction.execute() - } + focus: true + accountId: accountSwitcher.accountId } - */ - - Item { - Layout.fillWidth: true - } + KubeComponents.AccountSwitcher { + id: accountSwitcher - Controls2.TextField { - id: searchBar + anchors.bottom: parent.bottom - Layout.minimumWidth: Kirigami.Units.gridUnit * 19 - height: toolbar.height + width: parent.width + height: Kirigami.Units.gridUnit * 2 + } + } - placeholderText: "Search..." - } + KubeComponents.MailListView { + id: mailListView + parentFolder: folderListView.currentFolder + width: Kirigami.Units.gridUnit * 20 + height: parent.height + Layout.maximumWidth: app.width * 0.4 + Layout.minimumWidth: Kirigami.Units.gridUnit * 10 + focus: true + } - Item { - width: Kirigami.Units.smallSpacing - } - } - //END MailView section + KubeComponents.SingleMailView { + id: mailView + mail: mailListView.currentMail + Layout.fillWidth: true } } - //END ToolBar + //END Main content //BEGIN Composer KubeComponents.FocusComposer { @@ -319,7 +210,7 @@ Controls2.ApplicationWindow { width: app.width * 0.85 x: app.width * 0.075 - y: toolbar.y + toolbar.height + y: app.height * 0.075 } //END Composer @@ -327,13 +218,11 @@ Controls2.ApplicationWindow { KubeAccounts.AccountWizard { id: accountWizard - // visible: true - height: app.height * 0.85 width: app.width * 0.85 x: app.width * 0.075 - y: 50 + y: app.height * 0.075 } //END AccountWizard } -- cgit v1.2.3