[vlc-commits] qml: set differentiated highlight zone in KeyNavigableListView when the layout is Horizontal

Pierre Lamot git at videolan.org
Thu Feb 13 11:06:37 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Jan 27 17:57:52 2020 +0100| [02df9efd0665e51b13f96b3e58371d653df9aca0] | committer: Jean-Baptiste Kempf

qml: set differentiated highlight zone in KeyNavigableListView when the layout is Horizontal

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=02df9efd0665e51b13f96b3e58371d653df9aca0
---

 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..1f0928b261 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



More information about the vlc-commits mailing list