[vlc-devel] [PATCH 20/29] qml: add border to artist list item's cover images

Prince Gupta guptaprince8832 at gmail.com
Tue Aug 4 13:34:53 CEST 2020


---
 .../medialibrary/qml/MusicArtistsDisplay.qml  | 26 ++++++++++++++++---
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
index 408d46bc70..7424ca2f2f 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
@@ -134,6 +134,8 @@ Widgets.NavigableFocusScope {
                 width: artistList.width
 
                 property bool selected: selectionModel.isSelected(artistModel.index(index, 0))
+                property bool _highlighted: selected || this.hovered || this.activeFocus
+
                 Connections {
                    target: selectionModel
                    onSelectionChanged: selected = selectionModel.isSelected(artistModel.index(index, 0))
@@ -141,11 +143,27 @@ Widgets.NavigableFocusScope {
 
                 color: VLCStyle.colors.getBgColor(selected, this.hovered, this.activeFocus)
 
-                cover: Widgets.RoundImage {
-                    source: model.cover || VLCStyle.noArtArtistSmall
-                    height: VLCStyle.play_cover_small
+                cover: Item {
+
                     width: VLCStyle.play_cover_small
-                    radius: VLCStyle.play_cover_small
+                    height: VLCStyle.play_cover_small
+
+                    Widgets.RoundImage {
+                        source: model.cover || VLCStyle.noArtArtistSmall
+                        height: VLCStyle.play_cover_small
+                        width: VLCStyle.play_cover_small
+                        radius: VLCStyle.play_cover_small
+                        mipmap: true
+                    }
+
+                    Rectangle {
+                        height: VLCStyle.play_cover_small
+                        width: VLCStyle.play_cover_small
+                        radius: VLCStyle.play_cover_small
+                        color: 'transparent'
+                        border.width: VLCStyle.dp(1, scale)
+                        border.color: !_highlighted ? VLCStyle.colors.roundPlayCoverBorder : VLCStyle.colors.accent
+                    }
                 }
 
                 line1: model.name || i18n.qtr("Unknown artist")
-- 
2.25.1



More information about the vlc-devel mailing list