[vlc-commits] qml: use TableColumns.titleDelegate for cover column in MusicGenres list view
Prince Gupta
git at videolan.org
Thu Dec 17 14:57:19 UTC 2020
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Mon Dec 7 19:30:01 2020 +0530| [bbdb9496b9782de127a63991b4120722caa0963b] | committer: Pierre Lamot
qml: use TableColumns.titleDelegate for cover column in MusicGenres list view
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bbdb9496b9782de127a63991b4120722caa0963b
---
modules/gui/qt/medialibrary/qml/MusicGenres.qml | 37 +++++++------------------
1 file changed, 10 insertions(+), 27 deletions(-)
diff --git a/modules/gui/qt/medialibrary/qml/MusicGenres.qml b/modules/gui/qt/medialibrary/qml/MusicGenres.qml
index 75e73e5fdd..f0934fbd98 100644
--- a/modules/gui/qt/medialibrary/qml/MusicGenres.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicGenres.qml
@@ -229,32 +229,6 @@ Widgets.NavigableFocusScope {
VLCStyle.gridColumnsForWidth(tableView_id.availableRowWidth - VLCStyle.listAlbumCover_width - VLCStyle.column_margin_width) - 1
, 1)
- property Component thumbnailHeader: Item {
- Widgets.IconLabel {
- height: VLCStyle.listAlbumCover_height
- width: VLCStyle.listAlbumCover_width
- horizontalAlignment: Text.AlignHCenter
- text: VLCIcons.album_cover
- color: VLCStyle.colors.caption
- }
- }
-
- property Component thumbnailColumn: Item {
-
- property var rowModel: parent.rowModel
- property var model: parent.colModel
- readonly property bool currentlyFocused: parent.currentlyFocused
- readonly property bool containsMouse: parent.containsMouse
-
- Widgets.MediaCover {
- anchors.verticalCenter: parent.verticalCenter
- source: ( !rowModel ? undefined : rowModel[model.criteria] ) || VLCStyle.noArtCover
- playCoverVisible: currentlyFocused || containsMouse
- playIconSize: VLCStyle.play_cover_small
- onPlayIconClicked: medialib.addAndPlay( rowModel.id )
- }
- }
-
model: genreModel
selectionDelegateModel: selectionModel
headerColor: VLCStyle.colors.bg
@@ -266,7 +240,7 @@ Widgets.NavigableFocusScope {
headerTopPadding: VLCStyle.margin_normal
sortModel: [
- { isPrimary: true, criteria: "cover", width: VLCStyle.listAlbumCover_width, headerDelegate: thumbnailHeader, colDelegate: thumbnailColumn },
+ { isPrimary: true, criteria: "cover", width: VLCStyle.listAlbumCover_width, headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
{ criteria: "name", width: VLCStyle.colWidth(tableView_id._nameColSpan), text: i18n.qtr("Name") },
{ criteria: "nb_tracks", width: VLCStyle.colWidth(1), text: i18n.qtr("Tracks") }
]
@@ -277,6 +251,15 @@ Widgets.NavigableFocusScope {
onContextMenuButtonClicked: contextMenu.popup(selectionModel.selectedIndexes, menuParent.mapToGlobal(0,0))
onRightClick: contextMenu.popup(selectionModel.selectedIndexes, globalMousePos)
+
+ Widgets.TableColumns {
+ id: tableColumns
+
+ showTitleText: false
+ titleCover_height: VLCStyle.listAlbumCover_height
+ titleCover_width: VLCStyle.listAlbumCover_width
+ titleCover_radius: VLCStyle.listAlbumCover_radius
+ }
}
}
More information about the vlc-commits
mailing list