[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml/KeyNavigableListView: Create the 'enableFade' property

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Feb 12 22:47:13 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
1ccdca20 by Benjamin Arnaud at 2023-02-12T22:33:04+00:00
qml/KeyNavigableListView: Create the 'enableFade' property

And disable fading by default.

- - - - -
2b39f106 by Benjamin Arnaud at 2023-02-12T22:33:04+00:00
qml/PlaylistListView: Enable list fading

- - - - -
a5399a3b by Benjamin Arnaud at 2023-02-12T22:33:04+00:00
qml/VideoDisplayRecentVideos: Enable list fading

- - - - -
86cb8fd2 by Benjamin Arnaud at 2023-02-12T22:33:04+00:00
qml/FadingEdgeListView: Rename 'disableFade(s)' to 'enableFade(s)'

- - - - -


6 changed files:

- modules/gui/qt/maininterface/qml/MainTableView.qml
- modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
- modules/gui/qt/playlist/qml/PlaylistListView.qml
- modules/gui/qt/widgets/qml/FadingEdgeListView.qml
- modules/gui/qt/widgets/qml/KeyNavigableListView.qml
- modules/gui/qt/widgets/qml/KeyNavigableTableView.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/MainTableView.qml
=====================================
@@ -28,5 +28,5 @@ Widgets.KeyNavigableTableView {
 
     backgroundColor: VLCStyle.colors.bg
 
-    disableEndFade: g_mainDisplay.hasMiniPlayer
+    enableEndFade: (g_mainDisplay.hasMiniPlayer === false)
 }


=====================================
modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
=====================================
@@ -95,6 +95,9 @@ FocusScope {
 
             focus: true
 
+            // NOTE: We want a gentle fade at the beginning / end of the history.
+            enableFade: true
+
             backgroundColor: VLCStyle.colors.bg
 
             Navigation.parentItem: root


=====================================
modules/gui/qt/playlist/qml/PlaylistListView.qml
=====================================
@@ -282,6 +282,9 @@ Control {
 
             dragAutoScrollDragItem: dragItem
 
+            // NOTE: We want a gentle fade at the beginning / end of the playqueue.
+            enableFade: true
+
             backgroundColor: background.usingAcrylic ? "transparent"
                                                      : background.alternativeColor
 


=====================================
modules/gui/qt/widgets/qml/FadingEdgeListView.qml
=====================================
@@ -50,8 +50,8 @@ ListView {
         visible: proxyContentItem.visible && color.a > 0.0
     }
 
-    property bool disableBeginningFade: false
-    property bool disableEndFade: false
+    property bool enableBeginningFade: true
+    property bool enableEndFade: true
 
     property real fadeSize: root.delegateItem
                            ? (orientation === Qt.Vertical ? root.delegateItem.height
@@ -110,7 +110,7 @@ ListView {
                                                  ? root.height
                                                  : root.width) > (fadeSize * 2 + VLCStyle.dp(25))
 
-    readonly property bool _beginningFade: !disableBeginningFade &&
+    readonly property bool _beginningFade: enableBeginningFade &&
                                            _fadeRectEnoughSize &&
                                            (orientation === ListView.Vertical ? !atYBeginning
                                                                               : !atXBeginning) &&
@@ -118,7 +118,7 @@ ListView {
                                            (!firstVisibleItem.activeFocus &&
                                             !Helpers.get(firstVisibleItem, "hovered", false)))
 
-    readonly property bool _endFade:       !disableEndFade &&
+    readonly property bool _endFade:       enableEndFade &&
                                            _fadeRectEnoughSize &&
                                            (orientation === ListView.Vertical ? !atYEnd
                                                                               : !atXEnd) &&
@@ -126,14 +126,14 @@ ListView {
                                            (!lastVisibleItem.activeFocus &&
                                             !Helpers.get(lastVisibleItem, "hovered", false)))
 
-    BindingCompat on disableBeginningFade {
+    BindingCompat on enableBeginningFade {
         when: !!root.headerItem && (root.headerPositioning !== ListView.InlineHeader)
-        value: true
+        value: false
     }
 
-    BindingCompat on disableEndFade {
+    BindingCompat on enableEndFade {
         when: !!root.footerItem && (root.footerPositioning !== ListView.InlineFooter)
-        value: true
+        value: false
     }
 
     ShaderEffectSource {


=====================================
modules/gui/qt/widgets/qml/KeyNavigableListView.qml
=====================================
@@ -37,6 +37,10 @@ FadingEdgeListView {
 
     property bool keyNavigationWraps: false
 
+    // NOTE: Fading is disabled by default, 'enableBeginningFade' and 'enableEndFade' take
+    // precedence over 'enableFade'.
+    property bool enableFade: false
+
     // Private
 
     property bool _keyPressed: false
@@ -88,13 +92,13 @@ FadingEdgeListView {
     section.criteria: ViewSection.FullString
     section.delegate: sectionHeading
 
-    disableBeginningFade: (dragAutoScrollHandler.scrollingDirection
-                           ===
-                           Util.ViewDragAutoScrollHandler.Backward)
+    enableBeginningFade: (enableFade && dragAutoScrollHandler.scrollingDirection
+                                        !==
+                                        Util.ViewDragAutoScrollHandler.Backward)
 
-    disableEndFade: (dragAutoScrollHandler.scrollingDirection
-                     ===
-                     Util.ViewDragAutoScrollHandler.Forward)
+    enableEndFade: (enableFade && dragAutoScrollHandler.scrollingDirection
+                                  !==
+                                  Util.ViewDragAutoScrollHandler.Forward)
 
     Accessible.role: Accessible.List
 


=====================================
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
=====================================
@@ -111,8 +111,8 @@ FocusScope {
 
     property alias backgroundColor: view.backgroundColor
     property alias fadeSize: view.fadeSize
-    property alias disableBeginningFade: view.disableBeginningFade
-    property alias disableEndFade: view.disableEndFade
+    property alias enableBeginningFade: view.enableBeginningFade
+    property alias enableEndFade: view.enableEndFade
 
     property alias add:       view.add
     property alias displaced: view.displaced



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0e6b54602144269fe844a0ca536b83f9c941cc1b...86cb8fd2e2df1eac9dcdc93c5123583f71d33731

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0e6b54602144269fe844a0ca536b83f9c941cc1b...86cb8fd2e2df1eac9dcdc93c5123583f71d33731
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