Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/qml/EntryCommentsPage.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 Dan Leinir Turthra Jensen <admin@leinir.dk> | ||||
3 | * | ||||
4 | * This library is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU Lesser General Public | ||||
6 | * License as published by the Free Software Foundation; either | ||||
7 | * version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | * later version accepted by the membership of KDE e.V. (or its | ||||
9 | * successor approved by the membership of KDE e.V.), which shall | ||||
10 | * act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | * | ||||
12 | * This library is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | * Lesser General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU Lesser General Public | ||||
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | * | ||||
20 | */ | ||||
21 | | ||||
22 | /** | ||||
23 | * @brief A Kirigami.Page component used for displaying a NewStuff entry's comments | ||||
24 | */ | ||||
25 | | ||||
26 | import QtQuick 2.7 | ||||
27 | | ||||
28 | import org.kde.kirigami 2.7 as Kirigami | ||||
29 | import QtQuick.Controls 2.5 as QtControls | ||||
30 | import QtQuick.Layouts 1.12 as QtLayouts | ||||
31 | import org.kde.newstuff 1.0 as NewStuff | ||||
32 | | ||||
33 | Kirigami.ScrollablePage { | ||||
34 | id: component | ||||
35 | property string entryName | ||||
36 | property string entryAuthor | ||||
37 | property alias commentsModel: commentsView.model | ||||
38 | title: i18nc("Title for the page containing a view of the comments for the entry", "Comments and Reviews for %1").arg(component.entryName) | ||||
39 | Kirigami.CardsListView { | ||||
40 | id: commentsView | ||||
41 | QtLayouts.Layout.fillWidth: true | ||||
42 | delegate: EntryCommentDelegate { | ||||
43 | entryAuthor: component.entryAuthor | ||||
44 | author: model.username | ||||
45 | score: model.score | ||||
46 | title: model.subject | ||||
47 | reviewText: model.text | ||||
48 | } | ||||
49 | } | ||||
50 | } |