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 +++---- 3 files changed, 57 insertions(+), 47 deletions(-) (limited to 'components') 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 + } + } } -- cgit v1.2.3