[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: purge MultipleBinding.qml

François Cartegnie (@fcartegnie) gitlab at videolan.org
Fri Dec 8 20:05:48 UTC 2023



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
1f5e62ab by Fatih Uzunoglu at 2023-12-08T19:27:40+00:00
qml: purge MultipleBinding.qml

- - - - -
7b299caf by Fatih Uzunoglu at 2023-12-08T19:27:40+00:00
qml: set boundsBehavior for Flickables where applicable

- - - - -


8 changed files:

- modules/gui/qt/Makefile.am
- modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml
- modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
- modules/gui/qt/util/qml/FlickableScrollHandler.qml
- − modules/gui/qt/util/qml/MultipleBinding.qml
- modules/gui/qt/vlc.qrc
- modules/gui/qt/widgets/qml/ExpandGridView.qml
- modules/gui/qt/widgets/qml/KeyNavigableListView.qml


Changes:

=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -984,7 +984,6 @@ libqt_plugin_la_QML = \
 	gui/qt/style/qmldir \
 	gui/qt/util/qml/Helpers.js \
 	gui/qt/util/qml/ModelSortSettingHandler.qml \
-	gui/qt/util/qml/MultipleBinding.qml \
 	gui/qt/util/qml/FlickableScrollHandler.qml \
 	gui/qt/util/qml/ViewDragAutoScrollHandler.qml \
 	gui/qt/util/qml/BindingRev8.qml \


=====================================
modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml
=====================================
@@ -34,6 +34,7 @@ ListView {
 
     currentIndex: -1
     highlightFollowsCurrentItem: false
+    boundsBehavior: Flickable.StopAtBounds
 
     property bool containsDrag: footerItem.dropVisible
 


=====================================
modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
=====================================
@@ -41,6 +41,8 @@ GridView {
     cellWidth: VLCStyle.cover_small
     cellHeight: cellWidth
 
+    boundsBehavior: Flickable.StopAtBounds
+
     property alias removeInfoRectVisible: removeInfoRect.visible
 
     signal dragStarted(int id)


=====================================
modules/gui/qt/util/qml/FlickableScrollHandler.qml
=====================================
@@ -16,8 +16,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-import QtQml 2.11
-import QtQml.Models 2.12
+import QtQml 2.12
 
 import org.videolan.vlc 0.1 as VLC
 
@@ -27,29 +26,4 @@ VLC.FlickableScrollHandler {
     scaleFactor: VLC.MainCtx.intfScaleFactor
 
     enabled: !VLC.MainCtx.smoothScroll
-
-    Component.onCompleted: {
-        if (!enabled) {
-            // QTBUG-56075
-            // Note that this workaround is not effective when enabled dynamically changes
-            const 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
-                const smoothScroll = Qt.binding(function() { return VLC.MainCtx.smoothScroll })
-                handler.handleOnlyPixelDelta = smoothScroll
-                _behaviorAdjuster.when = smoothScroll
-                _behaviorAdjuster.model.append( {property: "flickDeceleration", value: 3500} )
-            }
-        }
-    }
-
-    readonly property MultipleBinding _behaviorAdjuster: MultipleBinding {
-        target: handler.parent
-        when: !handler.enabled
-
-        model: ListModel {
-            ListElement {property: "boundsBehavior"; value: 0 /* Flickable.StopAtBounds */}
-        }
-    }
 }


=====================================
modules/gui/qt/util/qml/MultipleBinding.qml deleted
=====================================
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2021 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * ( at your option ) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-import QtQuick 2.12
-import QtQml 2.11
-import QtQml.Models 2.12
-
-import org.videolan.compat 0.1
-
-QtObject {
-    id: root
-
-    property ListModel model
-    property alias enabled: instantiator.active
-    property alias asynchronous: instantiator.asynchronous
-
-    property QtObject target: null
-    property bool when
-    property bool delayed: false
-
-    readonly property QtObject _instantiator: Instantiator {
-        id: instantiator
-
-        model: root.model
-
-        delegate: BindingCompat {
-            target: model.target ? model.target
-                                 : root.target
-            when: model.when !== undefined ? model.when
-                                           : root.when
-            property: model.property
-            value: model.value
-            delayed: model.delayed !== undefined ? model.delayed
-                                                 : root.delayed
-        }
-    }
-}


=====================================
modules/gui/qt/vlc.qrc
=====================================
@@ -70,7 +70,6 @@
     </qresource>
     <qresource prefix="/util">
         <file alias="Helpers.js">util/qml/Helpers.js</file>
-        <file alias="MultipleBinding.qml">util/qml/MultipleBinding.qml</file>
         <file alias="ModelSortSettingHandler.qml">util/qml/ModelSortSettingHandler.qml</file>
         <file alias="FlickableScrollHandler.qml">util/qml/FlickableScrollHandler.qml</file>
         <file alias="ViewDragAutoScrollHandler.qml">util/qml/ViewDragAutoScrollHandler.qml</file>


=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -621,6 +621,8 @@ FocusScope {
 
         flickableDirection: Flickable.VerticalFlick
 
+        boundsBehavior: Flickable.StopAtBounds
+
         ScrollBar.vertical: ScrollBar {
             id: flickableScrollBar
         }


=====================================
modules/gui/qt/widgets/qml/KeyNavigableListView.qml
=====================================
@@ -83,6 +83,8 @@ ListView {
     highlightMoveDuration: 300 //ms
     highlightMoveVelocity: 1000 //px/s
 
+    boundsBehavior: Flickable.StopAtBounds
+
     section.property: ""
     section.criteria: ViewSection.FullString
     section.delegate: sectionHeading



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7dee44bfa637156f78bfa8c3ee55b0eafa309b23...7b299cafcd48a9f82da90df016e91c53ad47b3a0

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