[vlc-commits] qml: add border to artist list item's cover images
Prince Gupta
git at videolan.org
Mon Aug 10 12:09:45 CEST 2020
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Thu Jul 23 12:43:40 2020 +0530| [614ff0f71d6d860a0186056e4171dcc70b96e9c9] | committer: Pierre Lamot
qml: add border to artist list item's cover images
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=614ff0f71d6d860a0186056e4171dcc70b96e9c9
---
.../qt/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")
More information about the vlc-commits
mailing list