[vlc-devel] [PATCH 06/14] qml: set differentiated highlight zone in KeyNavigableListView when the layout is Horizontal

Pierre Lamot pierre at videolabs.io
Thu Feb 6 13:56:43 CET 2020


---
 modules/gui/qt/widgets/qml/KeyNavigableListView.qml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/widgets/qml/KeyNavigableListView.qml b/modules/gui/qt/widgets/qml/KeyNavigableListView.qml
index fb08bec6dc..5fa635a5ca 100644
--- a/modules/gui/qt/widgets/qml/KeyNavigableListView.qml
+++ b/modules/gui/qt/widgets/qml/KeyNavigableListView.qml
@@ -107,9 +107,12 @@ NavigableFocusScope {
         contentWidth: contentItem.childrenRect.width
         contentHeight: contentItem.childrenRect.height
 
-
-        preferredHighlightBegin : highlightMargin + (headerItem ? headerItem.height : 0)
-        preferredHighlightEnd : height - highlightMargin
+        preferredHighlightBegin : (view.orientation === ListView.Vertical)
+                                    ? highlightMargin + (headerItem ? headerItem.height : 0)
+                                    : highlightMargin
+        preferredHighlightEnd : (view.orientation === ListView.Vertical)
+                                    ? height - highlightMargin
+                                    : width- highlightMargin
         highlightRangeMode: ListView.ApplyRange
 
         focus: true
-- 
2.17.1



More information about the vlc-devel mailing list