[vlc-commits] [Git][videolan/vlc][master] 6 commits: qml: simplify FadingEdgeListView visibility logic

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jan 28 08:30:39 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
4ce9a5f9 by Fatih Uzunoglu at 2023-01-28T08:15:03+00:00
qml: simplify FadingEdgeListView visibility logic

- - - - -
9e5126e8 by Fatih Uzunoglu at 2023-01-28T08:15:03+00:00
qml: correct logic in FadingEdgeListView

- - - - -
330d450b by Fatih Uzunoglu at 2023-01-28T08:15:03+00:00
qml: disable fading when not applicable

I have not found a reliable way to support the effect
when there are non-inline footer/header and when
display margin is set.

- - - - -
f05d30ab by Fatih Uzunoglu at 2023-01-28T08:15:03+00:00
qml: disable end fade in MainTableView when MiniPlayer is visible

- - - - -
db7f3ad5 by Fatih Uzunoglu at 2023-01-28T08:15:03+00:00
qml: set default FadingEdgeListView background color

- - - - -
f04324fc by Fatih Uzunoglu at 2023-01-28T08:15:03+00:00
qml: set albumsList background color

- - - - -


4 changed files:

- modules/gui/qt/maininterface/qml/MainTableView.qml
- modules/gui/qt/medialibrary/qml/MusicArtist.qml
- modules/gui/qt/widgets/qml/FadingEdgeListView.qml
- modules/gui/qt/widgets/qml/KeyNavigableTableView.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/MainTableView.qml
=====================================
@@ -27,4 +27,6 @@ Widgets.KeyNavigableTableView {
     displayMarginEnd: g_mainDisplay.displayMargin
 
     backgroundColor: VLCStyle.colors.bg
+
+    disableEndFade: g_mainDisplay.hasMiniPlayer
 }


=====================================
modules/gui/qt/medialibrary/qml/MusicArtist.qml
=====================================
@@ -125,6 +125,8 @@ FocusScope {
                         orientation: ListView.Horizontal
                         spacing: VLCStyle.column_spacing
 
+                        backgroundColor: VLCStyle.colors.bg
+
                         Navigation.parentItem: root
 
                         Navigation.upAction: function() {


=====================================
modules/gui/qt/widgets/qml/FadingEdgeListView.qml
=====================================
@@ -44,6 +44,8 @@ ListView {
         implicitWidth: proxyContentItem.width
         implicitHeight: proxyContentItem.height
 
+        color: "transparent"
+
         z: -99
         visible: proxyContentItem.visible && color.a > 0.0
     }
@@ -74,13 +76,13 @@ ListView {
 
         var margin = 0 // -root.displayMarginBeginning
         if (orientation === Qt.Vertical) {
-            if (headerItem && headerItem.visible && headerPositioning === ListView.OverlayHeader)
-                margin += headerItem.height
+            // if (headerItem && headerItem.visible && headerPositioning === ListView.OverlayHeader)
+            //    margin += headerItem.height
 
             return itemAt(contentX + (delegateItem.x + delegateItem.width / 2), contentY + margin - displayMarginBeginning + spacing)
         } else {
-            if (headerItem && headerItem.visible && headerPositioning === ListView.OverlayHeader)
-                margin += headerItem.width
+            // if (headerItem && headerItem.visible && headerPositioning === ListView.OverlayHeader)
+            //    margin += headerItem.width
 
             return itemAt(contentX + margin - displayMarginBeginning + spacing, contentY + (delegateItem.y + delegateItem.height / 2))
         }
@@ -92,13 +94,13 @@ ListView {
 
         var margin = 0 // -root.displayMarginEnd
         if (orientation === Qt.Vertical) {
-            if (footerItem && footerItem.visible && footerPositioning === ListView.OverlayFooter)
-                margin += footerItem.height
+            // if (footerItem && footerItem.visible && footerPositioning === ListView.OverlayFooter)
+            //    margin += footerItem.height
 
             return itemAt(contentX + (delegateItem.x + delegateItem.width / 2), contentY + height - margin + displayMarginEnd - spacing - 1)
         } else {
-            if (footerItem && footerItem.visible && footerPositioning === ListView.OverlayFooter)
-                margin += footerItem.width
+            // if (footerItem && footerItem.visible && footerPositioning === ListView.OverlayFooter)
+            //    margin += footerItem.width
 
             return itemAt(contentX + width - margin + displayMarginEnd - spacing - 1, contentY + (delegateItem.y + delegateItem.height / 2))
         }
@@ -134,6 +136,16 @@ ListView {
         }
     }
 
+    BindingCompat on disableBeginningFade {
+        when: !!root.headerItem && (root.headerPositioning !== ListView.InlineHeader)
+        value: true
+    }
+
+    BindingCompat on disableEndFade {
+        when: !!root.footerItem && (root.footerPositioning !== ListView.InlineFooter)
+        value: true
+    }
+
     // When the effect is active,
     // it will clip inherently.
     // So the parent does not need
@@ -147,17 +159,16 @@ ListView {
     ShaderEffectSource {
         id: proxyContentItem
 
-        visible: (root._beginningFade || root._endFade) ||
-                 (layer.effect.beginningFadeSize > 0 || layer.effect.endFadeSize > 0)
+        visible: (root._beginningFade || root._endFade)
 
         BindingCompat on visible {
             // Let's see if the effect is compatible...
             value: false
-            when: proxyContentItem.effectCompatible
+            when: !proxyContentItem.effectCompatible
         }
 
-        readonly property bool effectCompatible: !(((GraphicsInfo.shaderType === GraphicsInfo.GLSL)) &&
-                                                  ((GraphicsInfo.shaderSourceType & GraphicsInfo.ShaderSourceString)))
+        readonly property bool effectCompatible: (((GraphicsInfo.shaderType === GraphicsInfo.GLSL)) &&
+                                                 ((GraphicsInfo.shaderSourceType & GraphicsInfo.ShaderSourceString)))
 
         anchors.top: parent.top
         anchors.left: parent.left


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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2a82ce9cfa889dd7059f7aee4954c29452dfbb91...f04324fc9906088fefd7b1ad79f54ad39010cda6

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