mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/summary: improve the spacing of the content
Use more idiomatic ways to indent the rows, replace the TemplateLabel with a simple Label since drawing the extra rectangle for the background of the TemplateLabel is obviously redundant and using it doesn't change the number of properties we need to set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5f6b7450a9
commit
fb057b7094
1 changed files with 20 additions and 14 deletions
|
|
@ -12,7 +12,7 @@ Kirigami.ScrollablePage {
|
||||||
DiveSummaryModel { id: summaryModel }
|
DiveSummaryModel { id: summaryModel }
|
||||||
property string firstDive: ""
|
property string firstDive: ""
|
||||||
property string lastDive: ""
|
property string lastDive: ""
|
||||||
property int headerColumnWidth: Math.floor(width / 4)
|
property int headerColumnWidth: Math.floor(width / 3)
|
||||||
|
|
||||||
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
||||||
title: qsTr("Dive summary")
|
title: qsTr("Dive summary")
|
||||||
|
|
@ -117,14 +117,19 @@ Kirigami.ScrollablePage {
|
||||||
id: rowDelegate
|
id: rowDelegate
|
||||||
Row {
|
Row {
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: headerLabel.height + Kirigami.Units.largeSpacing
|
||||||
|
Rectangle {
|
||||||
|
width: Kirigami.Units.gridUnit * 2
|
||||||
|
height: parent.height
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
||||||
width: headerColumnWidth
|
width: headerColumnWidth
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: headerLabel.height + Kirigami.Units.largeSpacing
|
||||||
TemplateLabel {
|
Label {
|
||||||
id: headerLabel
|
id: headerLabel
|
||||||
|
color: subsurfaceTheme.textColor
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
colorBackground: parent.color
|
|
||||||
leftPadding: Kirigami.Units.largeSpacing
|
leftPadding: Kirigami.Units.largeSpacing
|
||||||
text: header !== undefined ? header : ""
|
text: header !== undefined ? header : ""
|
||||||
font.bold: true
|
font.bold: true
|
||||||
|
|
@ -132,21 +137,21 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
||||||
width: headerColumnWidth * 1.5 - Kirigami.Units.gridUnit
|
width: headerColumnWidth - 2 * Kirigami.Units.gridUnit
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: headerLabel.height + Kirigami.Units.largeSpacing
|
||||||
TemplateLabel {
|
Label {
|
||||||
|
color: subsurfaceTheme.textColor
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
colorBackground: parent.color
|
|
||||||
text: col0 !== undefined ? col0 : ""
|
text: col0 !== undefined ? col0 : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
||||||
width: headerColumnWidth * 1.5 - Kirigami.Units.gridUnit
|
width: headerColumnWidth - 2 * Kirigami.Units.gridUnit
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: headerLabel.height + Kirigami.Units.largeSpacing
|
||||||
TemplateLabel {
|
Label {
|
||||||
|
color: subsurfaceTheme.textColor
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
colorBackground: parent.color
|
|
||||||
text: col1 !== undefined ? col1 : ""
|
text: col1 !== undefined ? col1 : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,12 +161,13 @@ Kirigami.ScrollablePage {
|
||||||
Component {
|
Component {
|
||||||
id: sectionDelegate
|
id: sectionDelegate
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: headerColumnWidth * 4 - Kirigami.Units.gridUnit * 2
|
width: headerColumnWidth * 3 - Kirigami.Units.gridUnit * 2
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: sectionLabel.height + Kirigami.Units.largeSpacing
|
||||||
TemplateLabel {
|
Label {
|
||||||
id: headerLabel
|
id: sectionLabel
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
colorBackground: parent.color
|
leftPadding: Kirigami.Units.largeSpacing
|
||||||
|
color: subsurfaceTheme.textColor
|
||||||
text: section
|
text: section
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue