Commit 19dbc556 authored by Nate Graham's avatar Nate Graham
Browse files

Display star ratings

Summary:
For quite some time, users and reviewers have been asking for Discover to display star ratings. This is really useful information, and becomes especially important now that we have multiple sort modes. People will think, "this list may be sorted by rating, but what **ARE** the ratings?"

This patch adds star ratings to the browse and search lists, and the detailed view pages.

It also adjusts the look of the delegates to better accommodate stars without becoming cluttered.

FEATURE: 389601
FIXED-IN: 5.13.0

Depends on D11842, because we need the extra space gained by removing the less-useful categories.

Test Plan:
Before:
{F5799814}

After, Applications page:
{F5800859}

After, Installed page:
{F5800867}

After, Applications Page in compact or mobile view:
{F5800861}

Reviewers: apol, #discover_software_store, #vdg

Reviewed By: apol, #discover_software_store

Subscribers: abetts, rkflx, fabianr, ragreen, acrouthamel, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11876
parent 0911fbcd
......@@ -30,6 +30,7 @@ Kirigami.AbstractCard
id: delegateArea
property alias application: installButton.application
property bool compact: false
property bool showRating: true
showClickFeedback: true
function trigger() {
......@@ -57,8 +58,9 @@ Kirigami.AbstractCard
}
ColumnLayout {
spacing: delegateArea.compact ? 3 : 5
spacing: delegateArea.compact ? 0 : 5
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
left: resourceIcon.right
leftMargin: Kirigami.Units.largeSpacing
......@@ -76,22 +78,29 @@ Kirigami.AbstractCard
InstallApplicationButton {
id: installButton
anchors {
verticalCenter: parent.verticalCenter
verticalCenter: delegateArea.compact ? parent.bottom: parent.verticalCenter
left: parent.right
}
}
}
Rectangle {
color: Kirigami.Theme.linkColor
Layout.fillWidth: true
Layout.rightMargin: delegateArea.compact ? installButton.width + Kirigami.Units.largeSpacing : 0
height: Kirigami.Units.devicePixelRatio / 2
RowLayout {
visible: showRating
spacing: Kirigami.Units.largeSpacing
Rating {
rating: delegateArea.application.rating ? delegateArea.application.rating.sortableRating : 0
starSize: delegateArea.compact ? summary.font.pointSize : head.font.pointSize
}
QQC2.Label {
text: delegateArea.application.rating ? i18n("%1 ratings", delegateArea.application.rating.ratingCount) : i18n("No ratings yet")
opacity: 0.5
}
}
Layout.fillWidth: true
QQC2.Label {
id: summary
Layout.fillWidth: true
bottomPadding: Kirigami.Units.smallSpacing
elide: Text.ElideRight
......
......@@ -116,7 +116,19 @@ DiscoverPage {
Layout.fillWidth: true
Layout.alignment: Text.AlignBottom
}
RowLayout {
spacing: Kirigami.Units.largeSpacing
Rating {
rating: appInfo.application.rating ? appInfo.application.rating.sortableRating : 0
starSize: summary.font.pointSize
}
QQC2.Label {
text: appInfo.application.rating ? i18n("%1 ratings", appInfo.application.rating.ratingCount) : i18n("No ratings yet")
opacity: 0.5
}
}
Kirigami.Heading {
id: summary
level: 4
text: appInfo.application.comment
maximumLineCount: 2
......
......@@ -45,6 +45,7 @@ DiscoverPage {
property alias listHeader: apps.header
property alias listHeaderPositioning: apps.headerPositioning
property bool compact: page.width < 500 || !applicationWindow().wideScreen
property bool showRating: true
property bool canNavigate: true
readonly property alias subcategories: appsModel.subcategories
......@@ -131,6 +132,7 @@ DiscoverPage {
delegate: ApplicationDelegate {
application: model.application
compact: page.compact
showRating: page.showRating
}
QQC2.Label {
......
......@@ -14,6 +14,7 @@ ApplicationsListPage {
title: i18n("Installed")
compact: true
showRating: false
canNavigate: false
listHeader: null
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment