From 1974c42f9372b09f7b9c6a85fec01e8dfab15092 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Sun, 24 Apr 2016 18:40:25 +0200 Subject: move search to the toolbar as discussed with VDG --- components/mail/contents/ui/main.qml | 128 +++++++++++++--------- components/package/contents/ui/FolderListView.qml | 23 +--- 2 files changed, 77 insertions(+), 74 deletions(-) diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 1c51c9f1..72987d74 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -18,6 +18,7 @@ import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 +import org.kde.kirigami 1.0 as Kirigami import org.kube.framework.actions 1.0 as KubeAction import org.kube.framework.settings 1.0 as KubeSettings @@ -64,45 +65,26 @@ ApplicationWindow { context: folderListContext } - //UI - toolBar: ToolBar { - Row { - anchors.fill: parent + ToolBar { + id: toolbar - ToolButton { - height: parent.height - text: "Settings" - onClicked: { - settingsComponent.createObject(app) - } - Component { - id: settingsComponent - KubeComponents.Settings { - id: settings - anchors.fill: parent - } - } - } + anchors { + top: app.top + left: app.left + } - ToolButton { - height: parent.height - iconName: "mail-message-new" - text: "Compose" - onClicked: { - composerComponent.createObject(app) - } - } + height: Kirigami.Units.iconSizes.medium + width: app.width - ToolButton { - height: parent.height - iconName: "mail-message-reply" - text: "Reply" - onClicked: { - composerComponent.createObject(app) - composer.originalMessage = mailListView.currentMail - } + + Row { + anchors { + left: parent.left + top: parent.top + bottom: parent.bottom } + Component { id: composerComponent KubeComponents.FocusComposer { @@ -111,6 +93,16 @@ ApplicationWindow { } } + ToolButton { + height: parent.height + iconName: "view-refresh" + text: "Sync" + enabled: syncAction.ready + onClicked: { + syncAction.execute() + } + } + ToolButton { height: parent.height iconName: "mail-mark-unread" @@ -142,39 +134,69 @@ ApplicationWindow { ToolButton { height: parent.height - iconName: "view-refresh" - text: "Sync" - enabled: syncAction.ready + iconName: "mail-message-new" + text: "Compose" onClicked: { - syncAction.execute() + composerComponent.createObject(app) } } + ToolButton { + height: parent.height + iconName: "mail-message-reply" + text: "Reply" + onClicked: { + composerComponent.createObject(app) + composer.originalMessage = mailListView.currentMail + } + } } - Rectangle { + + RowLayout { anchors { right: parent.right + verticalCenter: parent.verticalCenter } - height: parent.height - color: "transparent" - Image { - id: img - height: parent.height - fillMode: Image.PreserveAspectCrop - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: -20 + + width: Kirigami.Units.gridUnit * 40 + height: Kirigami.Units.iconSizes.medium + + TextField { + + Layout.fillWidth: true + + placeholderText: "Search..." + } + + ToolButton { + + height: Kirigami.Units.iconSizes.medium + + iconName: "application-menu" + text: "Settings" + + onClicked: { + settingsComponent.createObject(app) + } + Component { + id: settingsComponent + KubeComponents.Settings { + id: settings + anchors.fill: parent + } } - source: "image://kube/kube_logo" - sourceSize.height: parent.height * 2.5 } - width: img.width * 0.7 } } SplitView { - anchors.fill: parent + anchors { + top: toolbar.bottom + left: app.left + } + + height: app.height - toolbar.height + width: app.width KubeComponents.FolderListView { id: folderListView diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index e41220f5..62960fb9 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml @@ -30,28 +30,9 @@ Item { property variant currentFolder SystemPalette { id: colorPalette; colorGroup: SystemPalette.Active } - Item { - id: searchBox - - width: root.width - height: Unit.size * 10 - - TextField { - anchors. centerIn: parent - - width: parent.width * 0.9 - - placeholderText: "Search all email..." - } - } - Rectangle { - anchors { - top: searchBox.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - } + anchors.fill: parent + color: "white" ScrollView { anchors.fill: parent -- cgit v1.2.3