[vlc-commits] [Git][videolan/vlc][master] qml/KeyNavigableTableView: improve availableRowWidth updation

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Fri Feb 4 08:28:32 UTC 2022



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


Commits:
9edb29c7 by Prince Gupta at 2022-02-04T06:43:54+00:00
qml/KeyNavigableTableView: improve availableRowWidth updation

instead of manually tracking variables, use a temp variable for
debouncing, may fix random breaking of layout

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/KeyNavigableTableView.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
=====================================
@@ -68,6 +68,10 @@ FocusScope {
 
     property real availableRowWidth: 0
     property real _availabeRowWidthLastUpdateTime: Date.now()
+    readonly property real _currentAvailableRowWidth: root.width
+                                                      - root.sectionWidth * 2
+                                                      - (root.horizontalSpacing + _contextButtonHorizontalSpace)
+                                                      - (VLCStyle.margin_xxxsmall * 2)
 
     property Item dragItem
 
@@ -125,13 +129,7 @@ FocusScope {
         _qtAvoidSectionUpdate()
     }
 
-    onWidthChanged: {
-        availableRowWidthUpdater.enqueueUpdate()
-    }
-
-    onSectionChanged: {
-        availableRowWidthUpdater.enqueueUpdate()
-    }
+    on_CurrentAvailableRowWidthChanged: availableRowWidthUpdater.enqueueUpdate()
 
     /*
      *define the initial position/selection
@@ -204,9 +202,7 @@ FocusScope {
         }
 
         function _update() {
-            root.availableRowWidth = root.width
-                    - ( !!section.property ? VLCStyle.table_section_width * 2 : 0 )
-                    - (root.horizontalSpacing + _contextButtonHorizontalSpace)
+            root.availableRowWidth = root._currentAvailableRowWidth
             root._availabeRowWidthLastUpdateTime = Date.now()
         }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9edb29c737f84508e10b89bacda287b541e80921

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9edb29c737f84508e10b89bacda287b541e80921
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list