From 85e98907c6ea4300ad945fd3753e43cb75cafec6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 2 May 2017 14:22:11 +0200 Subject: Prepare different views in a stacklayout --- components/kube/contents/ui/Kube.qml | 94 ++++--------------------- components/kube/contents/ui/MailView.qml | 109 +++++++++++++++++++++++++++++ components/kube/contents/ui/PeopleView.qml | 31 ++++++++ components/kube/qmldir | 2 + 4 files changed, 154 insertions(+), 82 deletions(-) create mode 100644 components/kube/contents/ui/MailView.qml create mode 100644 components/kube/contents/ui/PeopleView.qml (limited to 'components') diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index eb280471..7b6c9a83 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml @@ -19,7 +19,7 @@ import QtQuick 2.7 import QtQuick.Controls 1.3 -import QtQuick.Layouts 1.1 +import QtQuick.Layouts 1.3 import QtQuick.Window 2.0 import QtQuick.Controls 2.0 as Controls2 @@ -157,91 +157,19 @@ Controls2.ApplicationWindow { Kube.AccountSwitcher {} } } - - SplitView { + StackLayout { + id: kubeViews + currentIndex: 0 anchors { top: mainContent.top bottom: mainContent.bottom } Layout.fillWidth: true - - Rectangle { - width: Kube.Units.gridUnit * 10 - Layout.minimumWidth: Kube.Units.gridUnit * 5 - - color: Kube.Colors.textColor - focus: true - - Kube.PositiveButton { - id: newMailButton - - anchors { - top: parent.top - left: parent.left - right: parent.right - margins: Kube.Units.largeSpacing - } - - text: qsTr("New Email") - - onClicked: { - composer.open() - } - } - - Kube.InlineAccountSwitcher { - id: accountFolderview - - activeFocusOnTab: true - anchors { - top: newMailButton.bottom - topMargin: Kube.Units.largeSpacing - bottom: parent.bottom - left: newMailButton.left - 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 } -// } -// ] -// } -// } -// } - - Kube.MailListView { - id: mailListView - width: Kube.Units.gridUnit * 20 - height: parent.height - Layout.minimumWidth: Kube.Units.gridUnit * 10 - } - - Kube.ConversationView { + MailView { id: mailView - Layout.fillWidth: true - Layout.minimumWidth: Kube.Units.gridUnit * 5 + } + PeopleView { + id: peopleView } } } @@ -320,15 +248,17 @@ Controls2.ApplicationWindow { //END Search //BEGIN People - Kube.People { + Kube.Popup { id: people - height: app.height * 0.85 width: app.width * 0.85 x: app.width * 0.075 y: app.height * 0.075 + Kube.People { + anchors.fill: parent + } } //END People } diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml new file mode 100644 index 00000000..b23dd06a --- /dev/null +++ b/components/kube/contents/ui/MailView.qml @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * Copyright (C) 2017 Christian Mollekopf, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +import QtQuick 2.7 +import QtQuick.Controls 1.3 +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 + + color: Kube.Colors.textColor + focus: true + + Kube.PositiveButton { + id: newMailButton + + anchors { + top: parent.top + left: parent.left + right: parent.right + margins: Kube.Units.largeSpacing + } + + text: qsTr("New Email") + + onClicked: { + composer.open() + } + } + + Kube.InlineAccountSwitcher { + id: accountFolderview + + activeFocusOnTab: true + anchors { + top: newMailButton.bottom + topMargin: Kube.Units.largeSpacing + bottom: parent.bottom + left: newMailButton.left + 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 } +// } +// ] +// } +// } +// } + + Kube.MailListView { + id: mailListView + width: Kube.Units.gridUnit * 20 + height: parent.height + Layout.minimumWidth: Kube.Units.gridUnit * 10 + } + + Kube.ConversationView { + id: mailView + Layout.fillWidth: true + Layout.minimumWidth: Kube.Units.gridUnit * 5 + } +} diff --git a/components/kube/contents/ui/PeopleView.qml b/components/kube/contents/ui/PeopleView.qml new file mode 100644 index 00000000..8d7a9fbd --- /dev/null +++ b/components/kube/contents/ui/PeopleView.qml @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * Copyright (C) 2017 Christian Mollekopf, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +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 +} diff --git a/components/kube/qmldir b/components/kube/qmldir index f663c916..95e7909e 100644 --- a/components/kube/qmldir +++ b/components/kube/qmldir @@ -1,3 +1,5 @@ module org.kube.components.kube Kube 1.0 Kube.qml +MailView 1.0 MailView.qml +PeopleView 1.0 PeopleView.qml -- cgit v1.2.3