From a93c303b8b8a426e5236825c7be9c5a42c597afd Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 8 Feb 2020 12:22:52 +0100 Subject: mobile/summary: add section headers Add section headers to the dive summaries on mobile by adding a section-property. Of course, this will not work on desktop. Signed-off-by: Berthold Stoeger Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveSummary.qml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mobile-widgets/qml/DiveSummary.qml') diff --git a/mobile-widgets/qml/DiveSummary.qml b/mobile-widgets/qml/DiveSummary.qml index 8f592ba4d..07939b48f 100644 --- a/mobile-widgets/qml/DiveSummary.qml +++ b/mobile-widgets/qml/DiveSummary.qml @@ -123,6 +123,7 @@ Kirigami.ScrollablePage { id: headerLabel verticalAlignment: Qt.AlignVCenter colorBackground: parent.color + leftPadding: Kirigami.Units.largeSpacing text: header !== undefined ? header : "" font.bold: true } @@ -150,6 +151,20 @@ Kirigami.ScrollablePage { } } + Component { + id: sectionDelegate + Rectangle { + width: headerColumnWidth * 4 - Kirigami.Units.gridUnit * 2 + height: headerLabel.height + Kirigami.Units.largeSpacing + TemplateLabel { + id: headerLabel + verticalAlignment: Qt.AlignVCenter + colorBackground: parent.color + text: section + font.bold: true + } + } + } ListView { id: resultsTable model: summaryModel @@ -157,6 +172,8 @@ Kirigami.ScrollablePage { width: summary.width height: summaryModel.rowCount() * 2 * Kirigami.Units.gridUnit delegate: rowDelegate + section.property: "section" + section.delegate: sectionDelegate Component.onCompleted: { manager.appendTextToLog("SUMMARY: width: " + width + " height: " + height + " rows: " + model.rowCount()) } -- cgit v1.2.3-70-g09d2