From fb12fcddb68e96580028072daa595d82fb3dd0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Wed, 12 Oct 2016 14:23:20 +0200 Subject: get the correct size for NewMailViewer in qml --- components/mailviewer/qml/MailViewer.qml | 60 ++++++++++++++++++++++++++++++++ components/mailviewer/qml/qmldir | 3 ++ 2 files changed, 63 insertions(+) create mode 100644 components/mailviewer/qml/MailViewer.qml create mode 100644 components/mailviewer/qml/qmldir (limited to 'components/mailviewer') diff --git a/components/mailviewer/qml/MailViewer.qml b/components/mailviewer/qml/MailViewer.qml new file mode 100644 index 00000000..f5714e25 --- /dev/null +++ b/components/mailviewer/qml/MailViewer.qml @@ -0,0 +1,60 @@ +/* + 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 + +Item { + id: mailviewer + height: mainColumn.height + 50 + width: parent.width * 0.9 + + Column { + id: mainColumn + anchors { + top: parent.top + left: parent.left + right: parent.right + margins: 20 + } + spacing: 10 + width: parent.width - 50 + + Repeater { + model: messageParser.newTree + + delegate: Column { + id: delegateRoot + + width: mainColumn.width + + Loader { + id: loader + } + + Component.onCompleted: { + switch (model.type) { + case "AlternativePart": + case "SinglePart": + loader.source = "MailPart.qml"; + break; + } + } + } + } + } +} diff --git a/components/mailviewer/qml/qmldir b/components/mailviewer/qml/qmldir new file mode 100644 index 00000000..0d87b779 --- /dev/null +++ b/components/mailviewer/qml/qmldir @@ -0,0 +1,3 @@ +module org.kube.mailviewer + +MailViewer 1.0 MailViewer.qml -- cgit v1.2.3