From d2b8c06df6d860a529bb37f5e6f4516d31f86fc2 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 2 May 2017 15:29:12 +0200 Subject: prepared composer in stacklayout, brought back statusbar --- components/kube/contents/ui/Kube.qml | 25 ++++++++---- components/kube/contents/ui/MailView.qml | 64 +++++++++++++++--------------- components/kube/contents/ui/PeopleView.qml | 15 +++---- framework/qml/FocusComposer.qml | 27 ++++++------- framework/qml/Messages.qml | 1 + 5 files changed, 70 insertions(+), 62 deletions(-) diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index bf7d987a..2d2ff4f5 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml @@ -61,11 +61,11 @@ Controls2.ApplicationWindow { } } - - //Model - Kube.AccountsModel { - id: currentAccountModel - accountId: accountFolderview.accountId + Kube.Listener { + filter: Kube.Messages.compose + onMessageReceived: { + composer.open() + } } //BEGIN Shortcuts @@ -171,19 +171,28 @@ Controls2.ApplicationWindow { PeopleView { id: peopleView } + ComposerView { + id: composerView + } } } //END Main content //BEGIN Composer - Kube.FocusComposer { - id: composer - + Kube.Popup { height: app.height * 0.85 width: app.width * 0.85 x: app.width * 0.075 y: app.height * 0.075 + + //Don't close the composer due to an accidental click outside + closePolicy: Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutsideParent + + Kube.FocusComposer { + id: composer + anchors.fill: parent + } } //END Composer diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml index b23dd06a..b579ff27 100644 --- a/components/kube/contents/ui/MailView.qml +++ b/components/kube/contents/ui/MailView.qml @@ -25,8 +25,6 @@ import QtQuick.Layouts 1.1 import org.kube.framework 1.0 as Kube SplitView { - Layout.fillWidth: true - Rectangle { width: Kube.Units.gridUnit * 10 Layout.minimumWidth: Kube.Units.gridUnit * 5 @@ -47,7 +45,7 @@ SplitView { text: qsTr("New Email") onClicked: { - composer.open() + Kube.Fabric.postMessage(Kube.Messages.compose, {}) } } @@ -63,36 +61,38 @@ SplitView { right: parent.right } } - } -//TODO bring back status bar -// Item { -// id: statusBar -// anchors { -// topMargin: Kube.Units.smallSpacing -// bottom: outbox.top -// left: parent.left -// right: parent.right -// } -// -// height: Kube.Units.gridUnit -// -// Repeater { -// model: currentAccountModel -// Kube.Label { -// id: statusText -// anchors.centerIn: parent -// visible: false -// color: Kube.Colors.highlightedTextColor -// states: [ -// State { -// name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus -// PropertyChanges { target: statusText; text: "Offline"; visible: true } -// } -// ] -// } -// } -// } + Item { + id: statusBar + anchors { + topMargin: Kube.Units.smallSpacing + bottom: parent.bottom + left: parent.left + right: parent.right + } + + height: Kube.Units.gridUnit + + Repeater { + model: Kube.AccountsModel { + accountId: accountFolderview.accountId + } + + Kube.Label { + id: statusText + anchors.centerIn: parent + visible: false + color: Kube.Colors.highlightedTextColor + states: [ + State { + name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus + PropertyChanges { target: statusText; text: "Offline"; visible: true } + } + ] + } + } + } + } Kube.MailListView { id: mailListView diff --git a/components/kube/contents/ui/PeopleView.qml b/components/kube/contents/ui/PeopleView.qml index 8d7a9fbd..19c7c60d 100644 --- a/components/kube/contents/ui/PeopleView.qml +++ b/components/kube/contents/ui/PeopleView.qml @@ -19,13 +19,14 @@ import QtQuick 2.7 -import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 - import org.kube.framework 1.0 as Kube -Kube.People { - id: people - - Layout.fillWidth: true +Item { + Kube.People { + id: people + anchors { + fill: parent + margins: Kube.Units.smallSpacing + } + } } diff --git a/framework/qml/FocusComposer.qml b/framework/qml/FocusComposer.qml index 7330b236..a3bad1c9 100644 --- a/framework/qml/FocusComposer.qml +++ b/framework/qml/FocusComposer.qml @@ -20,11 +20,10 @@ import QtQuick 2.4 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 as Controls2 -import org.kde.kirigami 1.0 as Kirigami import org.kube.framework 1.0 as Kube -Kube.Popup { +Item { id: root //Controller @@ -32,7 +31,6 @@ Kube.Popup { id: composerController onDone: { clear(); - root.close() } } @@ -40,14 +38,15 @@ Kube.Popup { property variant sendAction: composerController.sendAction property variant saveAsDraftAction: composerController.saveAsDraftAction - onClosed: { - composerController.clear() - to.text = "" - cc.visible = false - cc.text = "" - bcc.visible = false - bcc.text = "" - } + //FIXME + // onClosed: { + // composerController.clear() + // to.text = "" + // cc.visible = false + // cc.text = "" + // bcc.visible = false + // bcc.text = "" + // } //BEGIN functions function loadMessage(message, loadAsDraft) { @@ -55,9 +54,6 @@ Kube.Popup { } //END functions - //Don't close the composer due to an accidental click outside - closePolicy: Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutsideParent - Item { height: parent.height @@ -226,7 +222,8 @@ Kube.Popup { text: "Discard" onClicked: { - root.close() + //FIXME + // root.close() } } diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 26a3ea3e..a6ca6fe0 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml @@ -39,5 +39,6 @@ Item { property string synchronize: "synchronize" property string reply: "reply" property string edit: "edit" + property string compose: "compose" } -- cgit v1.2.3