[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: consider display margins properly in hover area placement of `FadingEdgeForListView`

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jun 16 08:47:16 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
858233ee by Fatih Uzunoglu at 2025-06-16T08:23:27+00:00
qml: consider display margins properly in hover area placement of `FadingEdgeForListView`

The display "margin" grows outwards the viewport, this can also be seen in `FadingEdge`
where its `ShaderEffectSource` use the negative of the display margin for its position
(left and top margins). The hover areas must perfectly overlap with the fading areas,
we need this change to satisfy that.

I also fix mistakenly using beginning margin for the end hover area.

- - - - -
adcaf45f by Fatih Uzunoglu at 2025-06-16T08:23:27+00:00
qml: set the display margins for the horizontal list view in `MusicArtist`

So that the fading edge effect does not clip the view. In fact, it still
"clips" but only outside the display margins, which I assume is wanted
anyway (see the last paragraph).

Due to the fundamental working of item layering, clipping is inevitable.
This is because in order to render an item offscreen, it is necessary to
know the boundaries of the offscreen buffer. Well, unless the buffer can
have infinite size, which I assume is not technically possible as that
would require infinite memory.

As a side note, the vertical artists list view stacked above in the left
side, and the playlist stacked above in the right side both have non-
opaque background so as to reveal window's background blur effect, but
they currently use a hack to not reveal any Qt Quick item rendered behind,
and even if this is changed in the future, we still do not want the items
in the horizontal view to appear behind. So, having the fading edge effect's
clipping is beneficial here. However, if in the future we stop using that
said hack, we need to have explicit clipping here even though the fading edge
effect clips the view, because the fading edge effect is disabled when
neither the beginning nor the end fade is enabled, which may have many
reasons including not having enough size to have fading effect, or, the
current item is the beginning item (so beginning fade is disabled) and
the user hovers the end item (so end fade is disabled).

- - - - -


2 changed files:

- modules/gui/qt/medialibrary/qml/MusicArtist.qml
- modules/gui/qt/widgets/qml/FadingEdgeForListView.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MusicArtist.qml
=====================================
@@ -162,6 +162,9 @@ FocusScope {
                         topMargin: VLCStyle.gridItemSelectedBorder
                         bottomMargin: VLCStyle.gridItemSelectedBorder
 
+                        displayMarginBeginning: root._contentLeftMargin
+                        displayMarginEnd: root._contentRightMargin
+
                         focus: true
 
                         model: albumModel


=====================================
modules/gui/qt/widgets/qml/FadingEdgeForListView.qml
=====================================
@@ -96,8 +96,8 @@ FadingEdge {
             top: parent.top
             left: parent.left
 
-            topMargin: (orientation === Qt.Vertical) ? beginningMargin : undefined
-            leftMargin: (orientation === Qt.Horizontal) ? beginningMargin : undefined
+            topMargin: (orientation === Qt.Vertical) ? -beginningMargin : undefined
+            leftMargin: (orientation === Qt.Horizontal) ? -beginningMargin : undefined
 
             bottom: (orientation === Qt.Horizontal) ? parent.bottom : undefined
             right: (orientation === Qt.Vertical) ? parent.right : undefined
@@ -125,8 +125,8 @@ FadingEdge {
             bottom: parent.bottom
             right: parent.right
 
-            bottomMargin: (orientation === Qt.Vertical) ? beginningMargin : undefined
-            rightMargin: (orientation === Qt.Horizontal) ? beginningMargin : undefined
+            bottomMargin: (orientation === Qt.Vertical) ? -endMargin : undefined
+            rightMargin: (orientation === Qt.Horizontal) ? -endMargin : undefined
 
             top: (orientation === Qt.Horizontal) ? parent.top : undefined
             left: (orientation === Qt.Vertical) ? parent.left : undefined



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c3b0aaf5c236c12398bda0aa353abbdae4ad9e56...adcaf45fd0d30563caaba2d1d69d898cbfa915d9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c3b0aaf5c236c12398bda0aa353abbdae4ad9e56...adcaf45fd0d30563caaba2d1d69d898cbfa915d9
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