[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: do bound checking in flickablePositionContaining

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Feb 20 12:12:38 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
6450c740 by Prince Gupta at 2025-02-20T11:40:30+00:00
qml: do bound checking in flickablePositionContaining

- - - - -
62fd4841 by Prince Gupta at 2025-02-20T11:40:30+00:00
qml: improve scrolling animation on click in ExpandGridView

- - - - -


2 changed files:

- modules/gui/qt/util/qml/Helpers.qml
- modules/gui/qt/widgets/qml/ExpandGridView.qml


Changes:

=====================================
modules/gui/qt/util/qml/Helpers.qml
=====================================
@@ -108,7 +108,7 @@ QtObject {
         else
             newContentY = flickable.contentY
 
-        return newContentY
+        return clamp(newContentY, flickable.originY, flickable.originY + flickable.contentHeight)
     }
 
     function isArray(obj) {


=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -115,6 +115,12 @@ FocusScope {
         property bool selected: false
     }
 
+    // extra margin taken in account for positionViewAtIndex
+    //
+    // this is required since delegates selection rect may occupy area outside of
+    // delegates, to make scrolling with selection better we add extra margins here
+    property real extraMarginForPositionView: verticalSpacing / 2
+
     property var _idChildrenList: []
     property var _unusedItemList: []
     property var _currentRange: [0,0]
@@ -508,7 +514,8 @@ FocusScope {
         const newContentY = Helpers.flickablePositionContaining(flickable,
                                                                 getItemPos(index)[1]
                                                                 , rowHeight
-                                                                , topMargin, bottomMargin)
+                                                                , topMargin + extraMarginForPositionView
+                                                                , bottomMargin + extraMarginForPositionView)
 
         if (newContentY !== flickable.contentY)
             animateFlickableContentY(newContentY)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8c12ef9595f81296b51719860e123bf0c6c01e50...62fd4841321890f2451bffc266540c7ed027ea42

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8c12ef9595f81296b51719860e123bf0c6c01e50...62fd4841321890f2451bffc266540c7ed027ea42
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