Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
d20eaacc by Fatih Uzunoglu at 2026-02-05T12:10:54+00:00
qml: expose `MediaCover` in `GridItem`
- - - - -
c999796b by Fatih Uzunoglu at 2026-02-05T12:10:54+00:00
qml: do not obstruct the thumbnail with progress bar in `VideoGridItem`
Instead of an overlay, the progress bar is now placed under the video
thumbnail. This can be done, because we can now set individual corner
radii since a47d9fb6.
- - - - -
1c6f9847 by Fatih Uzunoglu at 2026-02-05T12:10:54+00:00
qml: disable clipping when applicable in progress bar of `VideoGridItem`
Clipping should be avoided when possible, especially in delegates, as
noted in the docs (https://doc.qt.io/qt-6/qtquick-performance.html):
> Clipping inside a delegate is especially bad and should be avoided at
> all costs.
- - - - -
2 changed files:
- modules/gui/qt/medialibrary/qml/VideoGridItem.qml
- modules/gui/qt/widgets/qml/GridItem.qml
Changes:
=====================================
modules/gui/qt/medialibrary/qml/VideoGridItem.qml
=====================================
@@ -47,6 +47,46 @@ Widgets.GridItem {
pictureWidth: VLCStyle.gridCover_video_width
pictureHeight: VLCStyle.gridCover_video_height
+ // Bottom rounding is provided by the progress bar if it is visible:
+ mediaCover.radiusBottomLeft: progressBar.visible ? 0.0 : mediaCover.radius
+ mediaCover.radiusBottomRight: progressBar.visible ? 0.0 : mediaCover.radius
+
+ selectedShadow.height: selectedShadow.implicitHeight +
(progressBar.visible ? progressBar.height : 0.0)
+ unselectedShadow.height: unselectedShadow.implicitHeight +
(progressBar.visible ? progressBar.height : 0.0)
+
+ Widgets.VideoProgressBar {
+ id: progressBar
+
+ parent: root.mediaCover
+
+ // If the background color of the image is opaque (which should be
+ // the case by default), we can place the progress bar beneath the
+ // thumbnail and disable clipping because the top part would not be
+ // exposed. Note that the top part is still going to be painted, as
+ // long as the image is not opaque which is the expected case since
+ // SDF-based round images always have transparent parts which needs
+ // blending. If the image is not rounded and its blending is disabled,
+ // the top part of the bar is not going to be painted, thanks to depth
+ // testing. Furthermore, fragment shader may not even be executed for
+ // the top part that are obscured by the opaque image, provided that
+ // early depth test is applicable. In any case, since bottom radii
+ // are 0.0 and background color is opaque, the top part (if painted)
+ // will not be exposed to the user.
+ z: (root.mediaCover.color.a > (1.0 - Number.EPSILON)) ? -0.1 : 0.0
+ clip: (z >= 0.0)
+
+ anchors {
+ top: parent.bottom
+ left: parent.left
+ right: parent.right
+ }
+
+ visible: (model.progress > 0)
+
+ radius: root.pictureRadius
+ value: Helpers.clamp(model.progress !== undefined ? model.progress :
0, 0, 1)
+ }
+
pictureOverlay: Item {
implicitWidth: root.pictureWidth
implicitHeight: root.pictureHeight
@@ -76,21 +116,6 @@ Widgets.GridItem {
labels: root.labels
}
-
- Widgets.VideoProgressBar {
- id: progressBar
-
- anchors {
- bottom: parent.bottom
- left: parent.left
- right: parent.right
- }
-
- visible: (model.progress > 0)
-
- radius: root.pictureRadius
- value: Helpers.clamp(model.progress !== undefined ? model.progress
: 0, 0, 1)
- }
}
onPlayClicked: root.play()
=====================================
modules/gui/qt/widgets/qml/GridItem.qml
=====================================
@@ -49,6 +49,8 @@ T.ItemDelegate {
// Aliases
+ property alias mediaCover: picture
+
property alias image: picture.source
property alias cacheImage: picture.cacheImage
property alias fallbackImage: picture.fallbackImageSource
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/66ca57126232458bbff67f2dc9ea3ced5c364cff...1c6f9847a9594752c892a44a965cbfe7b395ca9e
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/66ca57126232458bbff67f2dc9ea3ced5c364cff...1c6f9847a9594752c892a44a965cbfe7b395ca9e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits