Commit cd998c2e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Make it possible to tweak the sorting of a resources list

Summary:
Now that we have context actions shown, we can consider doing it, will need
work for the header.

BUG: 383518

Reviewers: ngraham

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10589
parent c5b38923
......@@ -60,6 +60,37 @@ DiscoverPage {
appsModel.invalidateFilter()
refreshing = false
}
contextualActions: [
Kirigami.Action {
text: i18n("Sort")
Kirigami.Action {
text: i18n("Name")
onTriggered: {
appsModel.sortRole = ResourcesProxyModel.NameRole
appsModel.sortOrder = Qt.AscendingOrder
}
checked: appsModel.sortRole == ResourcesProxyModel.NameRole
}
Kirigami.Action {
text: i18n("Rating")
onTriggered: {
appsModel.sortRole = ResourcesProxyModel.RatingPointsRole
appsModel.sortOrder = Qt.AscendingOrder
}
checked: appsModel.sortRole == ResourcesProxyModel.RatingPointsRole
}
Kirigami.Action {
text: i18n("Size")
onTriggered: {
appsModel.sortRole = ResourcesProxyModel.SizeRole
appsModel.sortOrder = Qt.AscendingOrder
}
checked: appsModel.sortRole == ResourcesProxyModel.SizeRole
}
}
]
ListView {
id: apps
......
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