[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: use BindingCompat instead of Binding

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Mar 17 11:34:37 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
9144761e by Fatih Uzunoglu at 2022-03-17T10:36:59+00:00
qml: use BindingCompat instead of Binding

- - - - -
4db6521b by Fatih Uzunoglu at 2022-03-17T10:36:59+00:00
qml: apply QTBUG-56075 workaround only when necessary

- - - - -


2 changed files:

- modules/gui/qt/maininterface/qml/MainDisplay.qml
- modules/gui/qt/util/qml/FlickableScrollHandler.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -21,6 +21,7 @@ import QtQuick.Layouts 1.11
 import QtGraphicalEffects 1.0
 
 import org.videolan.vlc 0.1
+import org.videolan.compat 0.1
 
 import "qrc:///style/"
 import "qrc:///main/" as Main
@@ -444,7 +445,7 @@ FocusScope {
             P.MiniPlayer {
                 id: miniPlayer
 
-                Binding on state {
+                BindingCompat on state {
                     when: root._inhibitMiniPlayer && !miniPlayer.visible
                     value: ""
                 }


=====================================
modules/gui/qt/util/qml/FlickableScrollHandler.qml
=====================================
@@ -29,15 +29,18 @@ VLC.FlickableScrollHandler {
     enabled: !VLC.MainCtx.smoothScroll
 
     Component.onCompleted: {
-        // QTBUG-56075
-        var qtVersion = VLC.MainCtx.qtVersion()
-        if ((qtVersion >= VLC.MainCtx.qtVersionCheck(6, 0, 0) && qtVersion < VLC.MainCtx.qtVersionCheck(6, 2, 0)) ||
-            (qtVersion < VLC.MainCtx.qtVersionCheck(5, 15, 8))) {
-            handler.enabled = true
-            var smoothScroll = Qt.binding(function() { return VLC.MainCtx.smoothScroll })
-            handler.handleOnlyPixelDelta = smoothScroll
-            _behaviorAdjuster.when = smoothScroll
-            _behaviorAdjuster.model.append( {property: "flickDeceleration", value: 3500} )
+        if (!enabled) {
+            // QTBUG-56075
+            // Note that this workaround is not effective when enabled dynamically changes
+            var qtVersion = VLC.MainCtx.qtVersion()
+            if ((qtVersion >= VLC.MainCtx.qtVersionCheck(6, 0, 0) && qtVersion < VLC.MainCtx.qtVersionCheck(6, 2, 0)) ||
+                (qtVersion < VLC.MainCtx.qtVersionCheck(5, 15, 8))) {
+                handler.enabled = true
+                var smoothScroll = Qt.binding(function() { return VLC.MainCtx.smoothScroll })
+                handler.handleOnlyPixelDelta = smoothScroll
+                _behaviorAdjuster.when = smoothScroll
+                _behaviorAdjuster.model.append( {property: "flickDeceleration", value: 3500} )
+            }
         }
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a9ffd6aec1849e962077f6bc8956f3c20d472497...4db6521b34a9cfa70274794e34d81d62937a8a36

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