From 6fa7da4e1babb89bdf1e091a27d4efa4d1e7f456 Mon Sep 17 00:00:00 2001 From: Pierre Lamot Date: Wed, 30 Mar 2022 18:13:12 +0200 Subject: [PATCH] qml: udapte default placehoder in audio/video views --- modules/gui/qt/medialibrary/qml/AudioGridItem.qml | 2 +- modules/gui/qt/medialibrary/qml/MusicAlbums.qml | 2 +- modules/gui/qt/medialibrary/qml/MusicAllArtists.qml | 3 ++- modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml | 6 +++--- modules/gui/qt/medialibrary/qml/PlaylistMedia.qml | 4 +++- modules/gui/qt/medialibrary/qml/VideoGridItem.qml | 2 +- modules/gui/qt/medialibrary/qml/VideoListDisplay.qml | 2 ++ 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/gui/qt/medialibrary/qml/AudioGridItem.qml b/modules/gui/qt/medialibrary/qml/AudioGridItem.qml index 550234abd6..a4e482a5fe 100644 --- a/modules/gui/qt/medialibrary/qml/AudioGridItem.qml +++ b/modules/gui/qt/medialibrary/qml/AudioGridItem.qml @@ -27,7 +27,7 @@ Widgets.GridItem { property var model: ({}) property int index: -1 - image: model.cover || VLCStyle.noArtAlbum + image: model.cover || VLCStyle.noArtAlbumCover title: model.title || I18n.qtr("Unknown title") subtitle: model.main_artist || I18n.qtr("Unknown artist") pictureWidth: VLCStyle.gridCover_music_width diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml index 6e140d7a21..2f2a2ebb2f 100644 --- a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml +++ b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml @@ -227,7 +227,7 @@ FocusScope { headerTopPadding: VLCStyle.margin_normal sortModel: [ - { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: I18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate }, + { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: I18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate, placeHolder: VLCStyle.noArtAlbumCover }, { criteria: "main_artist", width: VLCStyle.colWidth(Math.max(tableView_id._nbCols - 3, 1)), text: I18n.qtr("Artist") }, { criteria: "duration", width:VLCStyle.colWidth(1), showSection: "", headerDelegate: tableColumns.timeHeaderDelegate, colDelegate: tableColumns.timeColDelegate }, ] diff --git a/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml b/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml index 3057aefe3b..6e9495055b 100644 --- a/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml +++ b/modules/gui/qt/medialibrary/qml/MusicAllArtists.qml @@ -137,6 +137,7 @@ FocusScope { delegate: AudioGridItem { id: gridItem + image: model.cover || VLCStyle.noArtArtistSmall title: model.name || I18n.qtr("Unknown artist") subtitle: model.nb_tracks > 1 ? I18n.qtr("%1 songs").arg(model.nb_tracks) : I18n.qtr("%1 song").arg(model.nb_tracks) pictureRadius: VLCStyle.artistGridCover_radius @@ -195,7 +196,7 @@ FocusScope { } sortModel: [ - { isPrimary: true, criteria: "name", width: VLCStyle.colWidth(Math.max(artistTable._nbCols - 1, 1)), text: I18n.qtr("Name"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate }, + { isPrimary: true, criteria: "name", width: VLCStyle.colWidth(Math.max(artistTable._nbCols - 1, 1)), text: I18n.qtr("Name"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate, placeHolder: VLCStyle.noArtArtistSmall }, { criteria: "nb_tracks", width: VLCStyle.colWidth(1), text: I18n.qtr("Tracks") } ] diff --git a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml index de9316b443..f42d02819a 100644 --- a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml @@ -31,14 +31,14 @@ Widgets.KeyNavigableTableView { id: root property var sortModelSmall: [ - { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(1), text: I18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate }, + { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(1), text: I18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate, placeHolder: VLCStyle.noArtAlbumCover }, { criteria: "album_title", width: VLCStyle.colWidth(1), text: I18n.qtr("Album"), showSection: "album_title" }, { criteria: "main_artist", width: VLCStyle.colWidth(1), text: I18n.qtr("Artist"), showSection: "main_artist" }, { criteria: "duration", width: VLCStyle.colWidth(1), text: I18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate }, ] property var sortModelMedium: [ - { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: I18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate }, + { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: I18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate, placeHolder: VLCStyle.noArtAlbumCover }, { criteria: "album_title", width: VLCStyle.colWidth(2), text: I18n.qtr("Album"), showSection: "album_title" }, { criteria: "main_artist", width: VLCStyle.colWidth(1), text: I18n.qtr("Artist"), showSection: "main_artist" }, { criteria: "duration", width: VLCStyle.colWidth(1), text: I18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate }, @@ -46,7 +46,7 @@ Widgets.KeyNavigableTableView { readonly property int _expandingColsSpan: Math.floor((VLCStyle.gridColumnsForWidth(root.availableRowWidth) - 3 /* static cols (track_number, etc)*/) / 3) property var sortModelLarge: [ - { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(root._expandingColsSpan), text: I18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate }, + { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(root._expandingColsSpan), text: I18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate, placeHolder: VLCStyle.noArtAlbumCover }, { criteria: "album_title", width: VLCStyle.colWidth(root._expandingColsSpan), text: I18n.qtr("Album"), showSection: "album_title" }, { criteria: "main_artist", width: VLCStyle.colWidth(root._expandingColsSpan), text: I18n.qtr("Artist"), showSection: "main_artist" }, { criteria: "duration", width: VLCStyle.colWidth(1), text: I18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate }, diff --git a/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml b/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml index 9edabccbb0..2324bae2b4 100644 --- a/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml +++ b/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml @@ -62,7 +62,9 @@ MainInterface.MainTableView { type: "image", headerDelegate: table.titleHeaderDelegate, - colDelegate : table.titleDelegate + colDelegate : table.titleDelegate, + + placeHolder: VLCStyle.noArtAlbumCover, }, { isPrimary: true, diff --git a/modules/gui/qt/medialibrary/qml/VideoGridItem.qml b/modules/gui/qt/medialibrary/qml/VideoGridItem.qml index 638134acab..947d1181fa 100644 --- a/modules/gui/qt/medialibrary/qml/VideoGridItem.qml +++ b/modules/gui/qt/medialibrary/qml/VideoGridItem.qml @@ -41,7 +41,7 @@ Widgets.GridItem { } } - image: model.thumbnail || VLCStyle.noArtCover + image: model.thumbnail || VLCStyle.noArtVideoCover title: model.title || I18n.qtr("Unknown title") subtitle: Helpers.msToString(model.duration) || "" pictureWidth: VLCStyle.gridCover_video_width diff --git a/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml b/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml index a47da83121..cd584ba3d8 100644 --- a/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml +++ b/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml @@ -55,6 +55,8 @@ MainInterface.MainTableView { showSection: "", + placeHolder: VLCStyle.noArtVideoCover, + headerDelegate: tableColumns.titleHeaderDelegate, colDelegate : tableColumns.titleDelegate, }, {