[vlc-commits] [Git][videolan/vlc][master] 5 commits: qml: respect `z` of root in `DoubleShadow`
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Nov 9 12:04:50 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
553b6e7e by Fatih Uzunoglu at 2025-11-09T11:47:17+00:00
qml: respect `z` of root in `DoubleShadow`
- - - - -
62c405bc by Fatih Uzunoglu at 2025-11-09T11:47:17+00:00
qml: use background coloring in grid expansion image
This is because if the image is translucent, it looks
off with the shadow in the background as the shadow
gets exposed.
We already use background coloring in most other
delegates, so this should make the expansion image
aligned with the rest.
It requires further investigation whether we should
switch to `ImageExt` in all cases. Historically we
are not using it in various places, such as playlist
delegate because rounding has not been needed there
and `ImageExt` (formerly `RoundImage`) used to be
used only for rounding.
Now, it is much more than mere rounding, and can be
useful in other cases, such as having preserve aspect
crop fill mode without requiring clipping.
Although `ImageExt` can be considered lightweight,
it is still heavier than bare `Image`, so switching
from `Image` to `ImageExt` needs to be justified.
Switching just because of background coloring may
not be a proper justification, because the same can
be achieved with a `Rectangle`, provided that the
image is not rounded.
- - - - -
fa3dd134 by Fatih Uzunoglu at 2025-11-09T11:47:17+00:00
qml: provide background rectangle for the image in `PlaylistDelegate`
- - - - -
00d127f0 by Fatih Uzunoglu at 2025-11-09T11:47:17+00:00
qml: make the shadow visible when image is ready in `ArtworkInfoWidget`
- - - - -
4b12e3fe by Fatih Uzunoglu at 2025-11-09T11:47:17+00:00
qml: provide background rectangle for the image in `ArtworkInfoWidget`
- - - - -
6 changed files:
- modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
- modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
- modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
- modules/gui/qt/playlist/qml/PlaylistDelegate.qml
- modules/gui/qt/widgets/qml/DoubleShadow.qml
- modules/gui/qt/widgets/qml/GridItem.qml
Changes:
=====================================
modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
=====================================
@@ -129,6 +129,7 @@ FocusScope {
? root.model.cover
: VLCStyle.noArtAlbumCover
sourceSize: Qt.size(width * eDPR, height * eDPR)
+ backgroundColor: theme.bg.primary
readonly property real eDPR: MainCtx.effectiveDevicePixelRatio(Window.window)
=====================================
modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
=====================================
@@ -116,6 +116,7 @@ FocusScope {
source: model.thumbnail || VLCStyle.noArtVideoCover
sourceSize: Qt.size(width * eDPR, height * eDPR)
radius: VLCStyle.gridCover_radius
+ backgroundColor: theme.bg.primary
readonly property real eDPR: MainCtx.effectiveDevicePixelRatio(Window.window)
=====================================
modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
=====================================
@@ -183,8 +183,26 @@ AbstractButton {
source = VLCStyle.noArtAlbumCover
}
- Widgets.DefaultShadow {
+ Rectangle {
+ // NOTE: If the image is opaque and if there is depth buffer, this rectangle
+ // is not going to be painted by the graphics backend. Though, it will
+ // still have its own scene graph node, as well as QML item.
+ // TODO: Investigate if using `ImageExt` just for its built-in background
+ // coloring is worth it.
+ anchors.centerIn: parent
+ anchors.alignWhenCentered: false
+ width: parent.paintedWidth
+ height: parent.paintedHeight
+ z: -1
+
+ color: theme.bg.primary
+
+ visible: (coverImage.status === Image.Ready)
+ }
+ Widgets.DefaultShadow {
+ visible: (coverImage.status === Image.Ready)
+ z: -2
}
}
=====================================
modules/gui/qt/playlist/qml/PlaylistDelegate.qml
=====================================
@@ -210,8 +210,26 @@ T.Control {
}
}
+ Rectangle {
+ // NOTE: If the image is opaque and if there is depth buffer, this rectangle
+ // is not going to be painted by the graphics backend. Though, it will
+ // still have its own scene graph node, as well as QML item.
+ // TODO: Investigate if using `ImageExt` just for its built-in background
+ // coloring is worth it.
+ anchors.centerIn: parent
+ anchors.alignWhenCentered: false
+ width: parent.paintedWidth
+ height: parent.paintedHeight
+ z: -1
+
+ color: theme.bg.primary
+
+ visible: (artwork.status === Image.Ready)
+ }
+
Widgets.DefaultShadow {
visible: (artwork.status === Image.Ready)
+ z: -2
}
}
=====================================
modules/gui/qt/widgets/qml/DoubleShadow.qml
=====================================
@@ -41,6 +41,7 @@ Item {
id: primaryShadow
parent: root.parent // similar to how Repeater behaves
+ z: root.z
opacity: root.opacity
visible: root.visible
@@ -51,6 +52,7 @@ Item {
id: secondaryShadow
parent: root.parent // similar to how Repeater behaves
+ z: root.z
opacity: root.opacity
visible: root.visible
=====================================
modules/gui/qt/widgets/qml/GridItem.qml
=====================================
@@ -322,6 +322,8 @@ T.ItemDelegate {
secondaryVerticalOffset: VLCStyle.dp(32, VLCStyle.scale)
secondaryBlurRadius: VLCStyle.dp(72, VLCStyle.scale)
+
+ z: -1
}
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bcc827cd66c3ccdf460de9735bbf0947ad6acc21...4b12e3fea526212836763ea480ac58d7479b6850
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bcc827cd66c3ccdf460de9735bbf0947ad6acc21...4b12e3fea526212836763ea480ac58d7479b6850
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list