Commit 1c972dd7 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵

the sort menu button has an arrow and improve its label

the menu entries now have just the name

the button is now Sort: %label%
parent c3f0f379
......@@ -141,7 +141,11 @@ ColumnLayout {
objectName: 'sortMenuButton'
visible: enableSorting && !showCreateRadioButton
text: (sortMenu.sortRoleName !== "" ? sortMenu.sortRoleName : i18nc("Sort By Menu Title with no sort selected", "Sort"))
text: if (sortMenu.sortRoleName !== "") {
i18nc("Sort By Menu Title with no sort selected", "Sort: %1", sortMenu.sortRoleName)
} else {
i18nc("Sort By Menu Title with no sort selected", "Sort")
}
display: AbstractButton.TextOnly
icon.name: "view-sort"
onClicked: {
......@@ -149,6 +153,14 @@ ColumnLayout {
sortMenu.open()
}
indicator: Image {
source: 'image://icon/arrow-down'
sourceSize.width: 16
sourceSize.height: 16
x: sortMenuButton.width - 16
y: sortMenuButton.height - 16
}
Layout.preferredWidth: textSize.width + Kirigami.Units.smallSpacing * 2
SortMenu {
......
......@@ -35,7 +35,7 @@ public:
ElisaUtils::Track,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Title")},
{i18n("Title")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
ViewManager::SingleAlbum,
......@@ -50,7 +50,7 @@ public:
ElisaUtils::Artist,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
{i18n("Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-artist")},
......@@ -65,7 +65,7 @@ public:
ElisaUtils::Album,
DataTypes::TitleRole,
{DataTypes::TitleRole, DataTypes::GenreRole, DataTypes::YearRole},
{i18n("Sort by Title"), i18n("Sort by Genre"), i18n("Sort by Year")},
{i18n("Title"), i18n("Genre"), i18n("Year")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("Oldest First"), i18n("Newest First")},
QUrl{QStringLiteral("image://icon/media-optical-audio")},
......@@ -80,7 +80,7 @@ public:
ElisaUtils::FileName,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
{i18n("Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/folder")},
......
......@@ -31,7 +31,7 @@ public:
ElisaUtils::Track,
DataTypes::LastPlayDate,
{DataTypes::LastPlayDate},
{i18n("Sort by Last Played Date")},
{i18n("Last Played Date")},
Qt::DescendingOrder,
{i18n("Least Recently Played First"), i18n("Most Recently Played First")},
ViewManager::MultipleAlbum,
......@@ -46,7 +46,7 @@ public:
ElisaUtils::Track,
DataTypes::PlayFrequency,
{DataTypes::PlayFrequency},
{i18n("Sort by Play Frequency")},
{i18n("Play Frequency")},
Qt::DescendingOrder,
{i18n("Least Frequently Played First"), i18n("Most Frequently Played First")},
ViewManager::MultipleAlbum,
......@@ -61,7 +61,7 @@ public:
ElisaUtils::Album,
DataTypes::TitleRole,
{DataTypes::TitleRole, DataTypes::ArtistRole, DataTypes::GenreRole, DataTypes::YearRole},
{i18n("Sort by Title"), i18n("Sort by Artist"), i18n("Sort by Genre"), i18n("Sort by Year")},
{i18n("Title"), i18n("Artist"), i18n("Genre"), i18n("Year")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("Oldest First"), i18n("Newest First")},
QUrl{QStringLiteral("image://icon/media-optical-audio")},
......@@ -76,7 +76,7 @@ public:
ElisaUtils::Artist,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
{i18n("Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-artist")},
......@@ -93,8 +93,8 @@ public:
{DataTypes::TitleRole, DataTypes::AlbumRole, DataTypes::ArtistRole,
DataTypes::GenreRole, DataTypes::YearRole, DataTypes::DurationRole,
DataTypes::ComposerRole, DataTypes::LyricistRole},
{i18n("Sort by Title"), i18n("Sort by Album"), i18n("Sort by Artist"), i18n("Sort by Genre"),
i18n("Sort by Year"), i18n("Sort by Duration"), i18n("Sort by Composer"), i18n("Sort by Lyricist")},
{i18n("Title"), i18n("Album"), i18n("Artist"), i18n("Genre"),
i18n("Year"), i18n("Duration"), i18n("Composer"), i18n("Lyricist")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"),
i18n("Oldest First"), i18n("Newest First"), i18n("Shortest First"), i18n("Longest First"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A")},
......@@ -110,7 +110,7 @@ public:
ElisaUtils::Genre,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Genre")},
{i18n("Genre")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-genre")},
......@@ -137,7 +137,7 @@ public:
ElisaUtils::Radio,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
{i18n("Name")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A")},
ViewManager::MultipleAlbum,
......@@ -530,7 +530,7 @@ void ViewsListData::refreshEmbeddedCategory()
ElisaUtils::Album,
Qt::DisplayRole,
{DataTypes::TitleRole, DataTypes::ArtistRole, DataTypes::GenreRole, DataTypes::YearRole},
{i18n("Sort by Title"), i18n("Sort by Artist"), i18n("Sort by Genre"), i18n("Sort by Year")},
{i18n("Title"), i18n("Artist"), i18n("Genre"), i18n("Year")},
Qt::AscendingOrder,
{i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("A-Z"), i18n("Z-A"), i18n("Oldest First"), i18n("Newest First")},
QUrl{QStringLiteral("image://icon/media-optical-audio")},
......@@ -549,7 +549,7 @@ void ViewsListData::refreshEmbeddedCategory()
ElisaUtils::Artist,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Name")},
{i18n("Name")},
Qt::AscendingOrder,
{QStringLiteral("A-Z"), QStringLiteral("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-artist")},
......@@ -568,7 +568,7 @@ void ViewsListData::refreshEmbeddedCategory()
ElisaUtils::Genre,
Qt::DisplayRole,
{Qt::DisplayRole},
{i18n("Sort by Genre")},
{i18n("Genre")},
Qt::AscendingOrder,
{QStringLiteral("A-Z"), QStringLiteral("Z-A")},
QUrl{QStringLiteral("image://icon/view-media-genre")},
......
Markdown is supported
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