[vlc-devel] [PATCH 10/18] qml: don't use 'state.when' for transitioning between states in GridItem

Prince Gupta guptaprince8832 at gmail.com
Wed Sep 23 19:40:08 CEST 2020


using 'when' produces an intermediatory null state when transiontioning causing not soo smooth animation
---
 modules/gui/qt/widgets/qml/GridItem.qml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/gui/qt/widgets/qml/GridItem.qml b/modules/gui/qt/widgets/qml/GridItem.qml
index ebd34d0f85..779eb3909f 100644
--- a/modules/gui/qt/widgets/qml/GridItem.qml
+++ b/modules/gui/qt/widgets/qml/GridItem.qml
@@ -71,10 +71,10 @@ FocusScope {
 
     property int _newIndicatorMedian: VLCStyle.margin_xsmall
 
+    state: _highlighted ? "selected" : "unselected"
     states: [
         State {
             name: "unselected"
-            when: !root._highlighted
             PropertyChanges {
                 target: root
                 _primaryShadowVerticalOffset: VLCStyle.dp(6, VLCStyle.scale)
@@ -86,7 +86,6 @@ FocusScope {
         },
         State {
             name: "selected"
-            when: root._highlighted
             PropertyChanges {
                 target: root
                 _primaryShadowVerticalOffset: VLCStyle.dp(32, VLCStyle.scale)
-- 
2.25.1



More information about the vlc-devel mailing list