[vlc-devel] [PATCH 03/17] qml: centre align section of KeyNavigableTableView

Prince Gupta guptaprince8832 at gmail.com
Fri Jun 19 16:06:16 CEST 2020


---
 .../gui/qt/widgets/qml/KeyNavigableTableView.qml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
index 718a02b576..75de47e522 100644
--- a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
+++ b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
@@ -87,6 +87,10 @@ NavigableFocusScope {
         headerPositioning: ListView.OverlayHeader
 
         header: Rectangle {
+
+            readonly property alias contentX: row.x
+            readonly property alias contentWidth: row.width
+
             width: parent.width
             height: childrenRect.height
             color: headerColor
@@ -98,6 +102,8 @@ NavigableFocusScope {
                 height: childrenRect.height
 
                 Row {
+                    id: row
+
                     anchors {
                         leftMargin: VLCStyle.margin_xxxsmall
                         rightMargin: VLCStyle.margin_xxxsmall
@@ -149,6 +155,16 @@ NavigableFocusScope {
             }
         }
 
+        section.delegate: Text {
+            x: headerItem.contentX - VLCStyle.table_section_width
+            topPadding: VLCStyle.margin_xsmall
+            bottomPadding: VLCStyle.margin_xxsmall
+            leftPadding: VLCStyle.table_section_text_margin
+            text: section
+            font.pixelSize: VLCStyle.fontHeight_normal
+            color: VLCStyle.colors.accent
+        }
+
         delegate:Rectangle {
             id: lineView
 
-- 
2.25.1



More information about the vlc-devel mailing list