[vlc-devel] [PATCH 10/27] qml: integrate new SortControl to playlist
Fatih Uzunoglu
fuzun54 at outlook.com
Fri Oct 9 18:56:31 CEST 2020
---
modules/gui/qt/playlist/qml/PlaylistToolbar.qml | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/playlist/qml/PlaylistToolbar.qml b/modules/gui/qt/playlist/qml/PlaylistToolbar.qml
index 408f692f7f..0a10abcb97 100644
--- a/modules/gui/qt/playlist/qml/PlaylistToolbar.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistToolbar.qml
@@ -95,10 +95,13 @@ Widgets.NavigableFocusScope {
{ text: i18n.qtr("Rating"), criteria: PlaylistControllerModel.SORT_KEY_RATIN },
]
textRole: "text"
-
+ criteriaRole: "criteria"
+
listWidth: VLCStyle.widthSortBox
onSortSelected: {
- mainPlaylistController.sort(modelData.criteria, PlaylistControllerModel.SORT_ORDER_ASC)
+ if (modelData.criteria !== sortKey)
+ mainPlaylistController.setSortOrder(PlaylistControllerModel.SORT_ORDER_ASC)
+ mainPlaylistController.setSortKey(modelData.criteria)
}
Keys.priority: Keys.AfterItem
@@ -106,6 +109,9 @@ Widgets.NavigableFocusScope {
navigationParent: playlistToolbar
_colors: playlistToolbar._colors
+
+ sortOrder: mainPlaylistController.sortOrder
+ sortKey: mainPlaylistController.sortKey
}
Widgets.IconToolButton {
--
2.25.1
More information about the vlc-devel
mailing list