From 13fe0524034d7fe3b7fa3a39f8df5ebeade9140e Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 8 Dec 2016 13:02:12 +0100 Subject: remove unnessesary flickable in conversation view --- components/package/contents/ui/SingleMailView.qml | 379 +++++++++++----------- 1 file changed, 186 insertions(+), 193 deletions(-) diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml index 49585b03..02ec504d 100644 --- a/components/package/contents/ui/SingleMailView.qml +++ b/components/package/contents/ui/SingleMailView.qml @@ -1,20 +1,20 @@ /* - Copyright (C) 2016 Michael Bohlender, - - 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. -*/ + * Copyright (C) 2016 Michael Bohlender, + * + * 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.4 import QtQuick.Controls 1.3 @@ -82,9 +82,7 @@ Rectangle { } - Flickable { - id: flickable - + ListView { anchors { top: subjectBar.bottom left: parent.left @@ -94,245 +92,240 @@ Rectangle { clip: true - ListView { - anchors.fill: parent + model: KubeFramework.MailListModel { + mail: root.mail + } - model: KubeFramework.MailListModel { - mail: root.mail - } + header: Item { + height: Kirigami.Units.gridUnit + width: parent.width - header: Item { - height: Kirigami.Units.gridUnit - width: parent.width + } - } + footer: Item { + height: Kirigami.Units.gridUnit * 2 + width: parent.width + } - footer: Item { - height: Kirigami.Units.gridUnit * 2 - width: parent.width - } + delegate: Item { - delegate: Item { + height: sheet.height + Kirigami.Units.gridUnit * 2 + width: parent.width - height: sheet.height + Kirigami.Units.gridUnit * 2 - width: parent.width + Rectangle { + id: sheet + anchors.centerIn: parent + implicitHeight: header.height + body.height + (Kirigami.Units.gridUnit * 2.5) * 2 + footer.height + width: parent.width - Kirigami.Units.gridUnit * 4 - Rectangle { - id: sheet - anchors.centerIn: parent - implicitHeight: header.height + body.height + (Kirigami.Units.gridUnit * 2.5) * 2 + footer.height - width: parent.width - Kirigami.Units.gridUnit * 4 + color: Kirigami.Theme.viewBackgroundColor - color: Kirigami.Theme.viewBackgroundColor + //TODO bookmark + /* + * ToolButton { + * iconName: "bookmark-new" + * + } + */ + //BEGIN header + Item { + id: header - //TODO bookmark - /* - ToolButton { - iconName: "bookmark-new" + height: Kirigami.Units.gridUnit * 5 + width: parent.width - } - */ - //BEGIN header - Item { - id: header - - height: Kirigami.Units.gridUnit * 5 - width: parent.width - - Row { - id: headerContent - anchors { - left: seperator.left - bottom: seperator.top - bottomMargin: height * 0.25 - } + Row { + id: headerContent + anchors { + left: seperator.left + bottom: seperator.top + bottomMargin: height * 0.25 + } - spacing: Kirigami.Units.largeSpacing / 2 + spacing: Kirigami.Units.largeSpacing / 2 - Avatar { - id: avatar + Avatar { + id: avatar - height: Kirigami.Units.gridUnit * 2.5 - width: height + height: Kirigami.Units.gridUnit * 2.5 + width: height - name: model.senderName - } + name: model.senderName + } - ColumnLayout { + ColumnLayout { - RowLayout { + RowLayout { - Text { - text: model.senderName + Text { + text: model.senderName - font.weight: Font.DemiBold - color: Kirigami.Theme.textColor - opacity: 0.75 - } + font.weight: Font.DemiBold + color: Kirigami.Theme.textColor + opacity: 0.75 + } - Text { - text: model.sender + Text { + text: model.sender - color: Kirigami.Theme.textColor - opacity: 0.75 - } + color: Kirigami.Theme.textColor + opacity: 0.75 } + } - RowLayout { - Kirigami.Label { - text: "To:" - } - Text { - text: model.to - - color: Kirigami.Theme.textColor - opacity: 0.75 - } - Text { - text: model.cc - - color: Kirigami.Theme.textColor - opacity: 0.75 - } - Text { - text: model.bcc - - color: Kirigami.Theme.textColor - opacity: 0.75 - } + RowLayout { + Kirigami.Label { + text: "To:" } - } - } + Text { + text: model.to + + color: Kirigami.Theme.textColor + opacity: 0.75 + } + Text { + text: model.cc - Text { + color: Kirigami.Theme.textColor + opacity: 0.75 + } + Text { + text: model.bcc - anchors { - right: seperator.right - bottom: headerContent.top + color: Kirigami.Theme.textColor + opacity: 0.75 + } } + } + } - text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") + Text { - font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 - color: Kirigami.Theme.textColor - opacity: 0.75 + anchors { + right: seperator.right + bottom: headerContent.top } - Rectangle { - id: seperator + text: Qt.formatDateTime(model.date, "dd MMM yyyy hh:mm") - anchors { - bottom: parent.bottom - horizontalCenter: parent.horizontalCenter - } + font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.7 + color: Kirigami.Theme.textColor + opacity: 0.75 + } - width: parent.width - Kirigami.Units.gridUnit * 2 - height: 1 + Rectangle { + id: seperator - color: Kirigami.Theme.textColor - opacity: 0.5 + anchors { + bottom: parent.bottom + horizontalCenter: parent.horizontalCenter } - Rectangle { - anchors { - bottom: seperator.top - right: seperator.right - } + width: parent.width - Kirigami.Units.gridUnit * 2 + height: 1 - height: Kirigami.Units.gridUnit - width: height + color: Kirigami.Theme.textColor + opacity: 0.5 + } - color: Kirigami.Theme.textColor - opacity: 0.5 + Rectangle { + anchors { + bottom: seperator.top + right: seperator.right + } - ToolButton { - anchors.fill: parent + height: Kirigami.Units.gridUnit + width: height - onClicked: { - console.error(model.mimeMessage) - } + color: Kirigami.Theme.textColor + opacity: 0.5 + + ToolButton { + anchors.fill: parent + + onClicked: { + console.error(model.mimeMessage) } } } - //END header + } + //END header - Flow { - id: attachments + Flow { + id: attachments - anchors { - top: header.bottom - topMargin: Kirigami.Units.smallSpacing - horizontalCenter: parent.horizontalCenter - } + anchors { + top: header.bottom + topMargin: Kirigami.Units.smallSpacing + horizontalCenter: parent.horizontalCenter + } - width: parent.width - Kirigami.Units.gridUnit * 2 - height: Kirigami.Units.gridUnit * 2 + width: parent.width - Kirigami.Units.gridUnit * 2 + height: Kirigami.Units.gridUnit * 2 - layoutDirection: Qt.RightToLeft - spacing: Kirigami.Units.smallSpacing + layoutDirection: Qt.RightToLeft + spacing: Kirigami.Units.smallSpacing - Repeater { - model: body.attachments + Repeater { + model: body.attachments - delegate: AttachmentDelegate { - name: model.name - icon: "mail-attachment" + delegate: AttachmentDelegate { + name: model.name + icon: "mail-attachment" - //TODO size encrypted signed type - } + //TODO size encrypted signed type } } + } - MailViewer { - id: body - - anchors { - top: header.bottom - left: parent.left - right: parent.right - leftMargin: avatar.height + Kirigami.Units.gridUnit - rightMargin: avatar.height + Kirigami.Units.gridUnit - topMargin: avatar.height - } - - width: header.width - Kirigami.Units.largeSpacing * 2 - height: desiredHeight + MailViewer { + id: body - message: model.mimeMessage + anchors { + top: header.bottom + left: parent.left + right: parent.right + leftMargin: avatar.height + Kirigami.Units.gridUnit + rightMargin: avatar.height + Kirigami.Units.gridUnit + topMargin: avatar.height } - Item { - id: footer + width: header.width - Kirigami.Units.largeSpacing * 2 + height: desiredHeight - anchors.bottom: parent.bottom + message: model.mimeMessage + } - height: Kirigami.Units.gridUnit * 2 - width: parent.width + Item { + id: footer - Text { + anchors.bottom: parent.bottom - anchors{ - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: Kirigami.Units.gridUnit - } + height: Kirigami.Units.gridUnit * 2 + width: parent.width - text: "Delete Mail" - color: Kirigami.Theme.textColor - opacity: 0.5 + Text { + + anchors{ + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: Kirigami.Units.gridUnit } - ToolButton { - anchors{ - verticalCenter: parent.verticalCenter - right: parent.right - rightMargin: Kirigami.Units.gridUnit - } + text: "Delete Mail" + color: Kirigami.Theme.textColor + opacity: 0.5 + } - iconName: "mail-reply-sender" + ToolButton { + anchors{ + verticalCenter: parent.verticalCenter + right: parent.right + rightMargin: Kirigami.Units.gridUnit } - } + iconName: "mail-reply-sender" + } } } } -- cgit v1.2.3