[vlc-commits] [Git][videolan/vlc][master] qml: fix symptomatic binding loop in `FadingEdgeForListView`

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Mar 30 07:10:05 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ce8cefe7 by Fatih Uzunoglu at 2025-03-30T06:43:32+00:00
qml: fix symptomatic binding loop in `FadingEdgeForListView`

This fixes the symptomatic binding loop introduced in
8e2b2ac6.

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/widgets/qml/FadingEdgeForListView.qml
=====================================
@@ -60,25 +60,27 @@ FadingEdge {
                                                                                   listView.currentItem.height)
                                                                         : Qt.rect(-1, -1, -1, -1)
 
-    enableBeginningFade: _fadeRectEnoughSize &&
-                         !beginningHoverHandler.hovered &&
-                         (orientation === Qt.Vertical ? !listView.atYBeginning
-                                                      : !listView.atXBeginning) &&
-                         Helpers.itemIntersects(beginningArea, _currentItemMappedRect)
-
-    enableEndFade: _fadeRectEnoughSize &&
-                   !endHoverHandler.hovered &&
-                   (orientation === Qt.Vertical ? !listView.atYEnd
-                                                : !listView.atXEnd) &&
-                   Helpers.itemIntersects(endArea, _currentItemMappedRect)
+    readonly property bool _disableBeginningFade: (!!listView.headerItem && (listView.headerPositioning !== ListView.InlineHeader)) ||
+                                                  !_fadeRectEnoughSize ||
+                                                  (orientation === Qt.Vertical ? listView.atYBeginning
+                                                                               : listView.atXBeginning) ||
+                                                  !Helpers.itemIntersects(beginningArea, _currentItemMappedRect)
+
+    readonly property bool _disableEndFade: (!!listView.footerItem && (listView.footerPositioning !== ListView.InlineFooter)) ||
+                                            !_fadeRectEnoughSize ||
+                                            (orientation === Qt.Vertical ? listView.atYEnd
+                                                                         : listView.atXEnd) ||
+                                            !Helpers.itemIntersects(endArea, _currentItemMappedRect)
 
     Binding on enableBeginningFade {
-        when: !!listView.headerItem && (listView.headerPositioning !== ListView.InlineHeader)
+        // This explicit binding is to override `enableBeginningFade` when it is not feasible to have fading edge.
+        when: root._disableBeginningFade || beginningHoverHandler.hovered
         value: false
     }
 
     Binding on enableEndFade {
-        when: !!listView.footerItem && (listView.footerPositioning !== ListView.InlineFooter)
+        // This explicit binding is to override `enableEndFade` when it is not feasible to have fading edge.
+        when: root._disableEndFade || endHoverHandler.hovered
         value: false
     }
 
@@ -88,7 +90,7 @@ FadingEdge {
         z: 99
         parent: root.listView
 
-        visible: root.enableBeginningFade
+        visible: !root._disableBeginningFade
 
         anchors {
             top: parent.top
@@ -117,7 +119,7 @@ FadingEdge {
         z: 99
         parent: root.listView
 
-        visible: root.enableEndFade
+        visible: !root._disableEndFade
 
         anchors {
             bottom: parent.bottom



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ce8cefe7600b19893e052a3fd1fa10ed1ab78f37

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