From 09962cc800b9ba2c5ab4ee16e0b6b39030023fe0 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Thu, 1 Oct 2026 10:21:09 +0200 Subject: [PATCH] Fix table rendering: left align, padding, nested Repeater scope - Store tableData at Rectangle level to avoid scope issues - Use ColumnLayout + RowLayout instead of GridLayout (cleaner nesting) - Anchor left instead of center - 8px margins, 16px column spacing - Add ?? false fallback for hasHeader to prevent undefined errors --- ui/qml/OutlineView.qml | 46 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/ui/qml/OutlineView.qml b/ui/qml/OutlineView.qml index 4364e3b..e2c3d4d 100644 --- a/ui/qml/OutlineView.qml +++ b/ui/qml/OutlineView.qml @@ -404,35 +404,41 @@ ListView { Component { id: tableComponent Rectangle { + id: tableRect color: theme.alternateBaseColor radius: 4 - implicitHeight: tableGrid.implicitHeight + 12 - implicitWidth: tableGrid.implicitWidth + 12 + implicitHeight: tableColumn.implicitHeight + 16 - GridLayout { - id: tableGrid - anchors.centerIn: parent - anchors.margins: 6 - columns: (modelData.rows && modelData.rows.length > 0) ? modelData.rows[0].length : 1 - rowSpacing: 4 - columnSpacing: 12 + property var tableData: modelData + + ColumnLayout { + id: tableColumn + anchors.left: parent.left + anchors.top: parent.top + anchors.margins: 8 + spacing: 2 Repeater { - model: modelData.rows ?? [] + model: tableRect.tableData.rows ?? [] - Repeater { + RowLayout { required property var modelData required property int index - property bool isHeader: index === 0 && tableComponent.modelData.hasHeader - model: modelData + property bool isHeader: index === 0 && (tableRect.tableData.hasHeader ?? false) + spacing: 16 - Label { - required property string modelData - text: modelData - color: parent.isHeader ? theme.textColor : theme.placeholderTextColor - font.bold: parent.isHeader - font.pointSize: outline.baseFontSize - horizontalAlignment: Text.AlignLeft + Repeater { + model: modelData + + Label { + required property string modelData + Layout.minimumWidth: 60 + text: modelData + color: parent.isHeader ? theme.textColor : theme.placeholderTextColor + font.bold: parent.isHeader + font.pointSize: outline.baseFontSize + horizontalAlignment: Text.AlignLeft + } } } }