QML UI: DiveList: some fine tuning of sizes and spacing

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-06-20 10:05:45 -07:00
parent 712d1e97f3
commit 157e14e11d

View file

@ -18,6 +18,7 @@ Kirigami.ScrollablePage {
property int credentialStatus: manager.credentialStatus property int credentialStatus: manager.credentialStatus
property int numDives: diveListView.count property int numDives: diveListView.count
property color textColor: subsurfaceTheme.diveListTextColor property color textColor: subsurfaceTheme.diveListTextColor
property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1
Component { Component {
id: diveDelegate id: diveDelegate
@ -32,7 +33,6 @@ Kirigami.ScrollablePage {
height: diveListEntry.height + Kirigami.Units.smallSpacing height: diveListEntry.height + Kirigami.Units.smallSpacing
property real detailsOpacity : 0 property real detailsOpacity : 0
property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1
// When clicked, the mode changes to details view // When clicked, the mode changes to details view
onClicked: { onClicked: {
@ -74,7 +74,7 @@ Kirigami.ScrollablePage {
color: textColor color: textColor
anchors { anchors {
left: parent.left left: parent.left
leftMargin: horizontalPadding leftMargin: horizontalPadding * 2
top: parent.top top: parent.top
right: parent.right right: parent.right
} }
@ -159,17 +159,18 @@ Kirigami.ScrollablePage {
height: childrenRect.height - Kirigami.Units.smallSpacing height: childrenRect.height - Kirigami.Units.smallSpacing
Rectangle { Rectangle {
id: leftBar id: leftBar
height: section == "" ? 0 : headingBackground.height
width: Kirigami.Units.gridUnit * 1 width: Kirigami.Units.gridUnit * 1
color: subsurfaceTheme.accentColor color: subsurfaceTheme.accentColor
visible: section != "" visible: section != ""
anchors { anchors {
left: parent.left left: parent.left
top: headingBackground.top
bottom: headingBackground.bottom
} }
} }
Rectangle { Rectangle {
id: headingBackground id: headingBackground
height: section == "" ? 0 : Kirigami.Units.gridUnit * 3 height: section == "" ? 0 : Kirigami.Units.gridUnit * 2.5
anchors { anchors {
left: leftBar.right left: leftBar.right
right: parent.right right: parent.right
@ -198,7 +199,7 @@ Kirigami.ScrollablePage {
top: parent.top top: parent.top
left: parent.left left: parent.left
topMargin: Math.max(2, Kirigami.Units.gridUnit / 2) topMargin: Math.max(2, Kirigami.Units.gridUnit / 2)
leftMargin: Kirigami.Units.gridUnit / 2 leftMargin: horizontalPadding
right: parent.right right: parent.right
} }
color: textColor color: textColor