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

Use an action group for the sort options

Summary:
Otherwise we get ugly checkboxes.
Requires Qt 5.10.

Depends on D10892

BUG: 391144

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10893
parent 4fb85f5c
......@@ -19,7 +19,7 @@
import QtQuick 2.5
import QtQuick.Controls 1.1
import QtQuick.Controls 2.1 as QQC2
import QtQuick.Controls 2.3 as QQC2
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import "navigation.js" as Navigation
......@@ -58,10 +58,16 @@ DiscoverPage {
refreshing = false
}
QQC2.ActionGroup {
id: sortGroup
exclusive: true
}
contextualActions: [
Kirigami.Action {
text: i18n("Sort")
Kirigami.Action {
QQC2.Action {
QQC2.ActionGroup.group: sortGroup
text: i18n("Name")
onTriggered: {
appsModel.sortRole = ResourcesProxyModel.NameRole
......@@ -70,7 +76,8 @@ DiscoverPage {
checkable: true
checked: appsModel.sortRole == ResourcesProxyModel.NameRole
}
Kirigami.Action {
QQC2.Action {
QQC2.ActionGroup.group: sortGroup
text: i18n("Rating")
onTriggered: {
appsModel.sortRole = ResourcesProxyModel.RatingPointsRole
......@@ -79,7 +86,8 @@ DiscoverPage {
checkable: true
checked: appsModel.sortRole == ResourcesProxyModel.RatingPointsRole
}
Kirigami.Action {
QQC2.Action {
QQC2.ActionGroup.group: sortGroup
text: i18n("Size")
onTriggered: {
appsModel.sortRole = ResourcesProxyModel.SizeRole
......
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