diff --git a/discover/qml/ReviewDelegate.qml b/discover/qml/ReviewDelegate.qml --- a/discover/qml/ReviewDelegate.qml +++ b/discover/qml/ReviewDelegate.qml @@ -30,12 +30,6 @@ property bool separator: true signal markUseful(bool useful) - function usefulnessToString(favorable, total) - { - return total===0 - ? i18n("Tell us about this review!") - : i18n("%1 out of %2 people found this review useful", favorable, total) - } Repeater { model: depth @@ -82,28 +76,49 @@ visible: !item.compact text: item.usefulnessToString(usefulnessFavorable, usefulnessTotal) } + } + Label { + Layout.fillWidth: true + text: display + maximumLineCount: item.compact ? 3 : undefined + wrapMode: Text.Wrap + } + + RowLayout { + Layout.fillWidth: true + visible: !item.compact + opacity: 0.7 + + Item { + Layout.fillWidth: true + } + + Label { + visible: usefulnessTotal !== 0 + text: i18n("%1 out of %2 people found this review useful", usefulnessFavorable, usefulnessTotal) + font.pointSize: theme.smallestFont.pointSize + } Label { - visible: !item.compact - Layout.alignment: Qt.AlignRight text: { switch(usefulChoice) { case ReviewsModel.Yes: - i18n("Useful? Yes/No") + i18n("👍/👎") break; case ReviewsModel.No: - i18n("Useful? Yes/No") + i18n("👍/👎") break; default: - i18n("Useful? Yes/No") + i18n("👍/👎") break; } } + font.pointSize: theme.smallestFont.pointSize onLinkActivated: item.markUseful(link=='true') } - Kirigami.Separator { - visible: item.separator - Layout.fillWidth: true - } + } + Kirigami.Separator { + visible: item.separator + Layout.fillWidth: true } }