[vlc-commits] qml: use GridItem.pictureOverlay property for custom covers in NetworkGridItem
Prince Gupta
git at videolan.org
Mon Sep 28 14:01:36 CEST 2020
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Mon Sep 14 20:43:52 2020 +0530| [9a453f653b37a28bad12a192f6d02bd128395f6c] | committer: Pierre Lamot
qml: use GridItem.pictureOverlay property for custom covers in NetworkGridItem
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9a453f653b37a28bad12a192f6d02bd128395f6c
---
modules/gui/qt/network/qml/NetworkGridItem.qml | 63 +++++++++++++-------------
1 file changed, 32 insertions(+), 31 deletions(-)
diff --git a/modules/gui/qt/network/qml/NetworkGridItem.qml b/modules/gui/qt/network/qml/NetworkGridItem.qml
index 28fad0cc31..e79a341de0 100644
--- a/modules/gui/qt/network/qml/NetworkGridItem.qml
+++ b/modules/gui/qt/network/qml/NetworkGridItem.qml
@@ -41,41 +41,42 @@ Widgets.GridItem {
subtitle: model.mrl || ""
title: model.name || i18n.qtr("Unknown share")
- Image {
- id: custom_cover
+ pictureOverlay: Item {
+ Image {
+ id: custom_cover
- x: (pictureWidth - this.width) / 2
- y: (pictureHeight - this.height) / 2
- width: VLCStyle.icon_normal
- height: VLCStyle.icon_normal
- opacity: item._highlighted && !item.playCoverOnlyBorders ? .1 : 1
- visible: !model.artwork || model.artwork.toString() === ""
- source: {
- switch (model.type){
- case NetworkMediaModel.TYPE_DISC:
- return "qrc:///type/disc.svg"
- case NetworkMediaModel.TYPE_CARD:
- return "qrc:///type/capture-card.svg"
- case NetworkMediaModel.TYPE_STREAM:
- return "qrc:///type/stream.svg"
- case NetworkMediaModel.TYPE_PLAYLIST:
- return "qrc:///type/playlist.svg"
- case NetworkMediaModel.TYPE_FILE:
- return "qrc:///type/file_black.svg"
- default:
- return "qrc:///type/directory_black.svg"
+ x: (pictureWidth - this.width) / 2
+ y: (pictureHeight - this.height) / 2
+ width: VLCStyle.icon_normal
+ height: VLCStyle.icon_normal
+ visible: !model.artwork || model.artwork.toString() === ""
+ source: {
+ switch (model.type){
+ case NetworkMediaModel.TYPE_DISC:
+ return "qrc:///type/disc.svg"
+ case NetworkMediaModel.TYPE_CARD:
+ return "qrc:///type/capture-card.svg"
+ case NetworkMediaModel.TYPE_STREAM:
+ return "qrc:///type/stream.svg"
+ case NetworkMediaModel.TYPE_PLAYLIST:
+ return "qrc:///type/playlist.svg"
+ case NetworkMediaModel.TYPE_FILE:
+ return "qrc:///type/file_black.svg"
+ default:
+ return "qrc:///type/directory_black.svg"
+ }
}
}
- }
- ColorOverlay {
- anchors.fill: custom_cover
- source: custom_cover
- color: VLCStyle.colors.text
- visible: custom_cover.visible
- && model.type !== NetworkMediaModel.TYPE_DISC
- && model.type !== NetworkMediaModel.TYPE_CARD
- && model.type !== NetworkMediaModel.TYPE_STREAM
+ ColorOverlay {
+ anchors.fill: custom_cover
+ source: custom_cover
+ color: VLCStyle.colors.text
+ visible: custom_cover.visible
+ && model.type !== NetworkMediaModel.TYPE_DISC
+ && model.type !== NetworkMediaModel.TYPE_CARD
+ && model.type !== NetworkMediaModel.TYPE_STREAM
+ }
}
}
More information about the vlc-commits
mailing list