13 import QtQuick.Layouts 1.11 as QtLayouts
25 property QtObject engine
30 property string entryAuthorId
34 property string entryProviderId
39 property string author
52 property alias reviewText: reviewLabel.text
60 property QtObject commentAuthor: NewStuff.Author {
61 engine: component.engine
62 providerId: component.entryProviderId
63 username: component.author
69 leftMargin:
Kirigami.Units.largeSpacing
70 rightMargin:
Kirigami.Units.largeSpacing
74 model: component.depth
76 QtLayouts.Layout.fillHeight:
true 77 QtLayouts.Layout.minimumWidth:
Kirigami.Units.largeSpacing
78 QtLayouts.Layout.maximumWidth:
Kirigami.Units.largeSpacing
87 color:
Kirigami.Theme.backgroundColor
92 QtLayouts.ColumnLayout {
94 visible: component.depth === 0
95 QtLayouts.Layout.fillWidth:
true 96 QtLayouts.Layout.minimumHeight:
Kirigami.Units.largeSpacing
97 QtLayouts.Layout.maximumHeight:
Kirigami.Units.largeSpacing
101 QtLayouts.Layout.fillWidth:
true 104 QtLayouts.RowLayout {
105 visible: (component.title !==
"" || component.score !== 0)
106 QtLayouts.Layout.fillWidth:
true 107 QtLayouts.Layout.leftMargin:
Kirigami.Units.largeSpacing
110 text: ((component.title ===
"") ?
i18ndc(
"knewstuff5",
"Placeholder title for when a comment has no subject, but does have a rating",
"<i>(no title)</i>") : component.title)
112 QtLayouts.Layout.fillWidth:
true 116 rating: Math.floor(component.score / 10)
119 QtLayouts.Layout.minimumWidth:
Kirigami.Units.largeSpacing
120 QtLayouts.Layout.maximumWidth:
Kirigami.Units.largeSpacing
126 QtLayouts.Layout.fillWidth:
true 127 QtLayouts.Layout.leftMargin:
Kirigami.Units.largeSpacing
128 QtLayouts.Layout.rightMargin:
Kirigami.Units.largeSpacing
132 QtLayouts.RowLayout {
133 QtLayouts.Layout.fillWidth:
true 135 QtLayouts.Layout.fillWidth:
true 139 visible: (url !==
"")
140 url: (component.commentAuthor.homepage ===
"") ? component.commentAuthor.profilepage : component.commentAuthor.homepage
141 text: (component.author === component.entryAuthorId) ?
i18ndc(
"knewstuff5",
"The author label in case the comment was written by the author of the content entry the comment is attached to",
"%1 <i>(author)</i>", component.commentAuthor.name) : component.commentAuthor.name
144 visible: !authorLabel.visible
145 text: authorLabel.text
149 QtLayouts.Layout.maximumWidth: height
150 QtLayouts.Layout.minimumWidth: height
151 QtLayouts.Layout.preferredHeight:
Kirigami.Units.iconSizes.medium
152 fillMode: Image.PreserveAspectFit
153 source: component.commentAuthor.avatarUrl
155 anchors.fill: parent;
158 opacity: authorIcon.status == Image.Ready ? 0 : 1
159 Behavior on opacity { NumberAnimation { duration:
Kirigami.Units.shortDuration; } }
163 QtLayouts.Layout.minimumWidth:
Kirigami.Units.largeSpacing
164 QtLayouts.Layout.maximumWidth:
Kirigami.Units.largeSpacing
168 QtLayouts.Layout.fillWidth:
true 169 QtLayouts.Layout.minimumHeight:
Kirigami.Units.largeSpacing
170 QtLayouts.Layout.maximumHeight:
Kirigami.Units.largeSpacing
QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
QTextStream & left(QTextStream &s)
QTextStream & right(QTextStream &s)