QML UI: Another attempt to shift dive number to top row

Commit 1030cb265a 'QML UI DiveDetailsView: shift
dive number to right of top row' was reverted because it caused mysterious
crashes for some testers, inferred to be related to sizing items in a
gridLayout.

This patch brings the dive number back up to the right of the top row, so the
page width doesn't exceed the screen width. Using text wrapping should prevent
the date text and dive number items from increasing in width, and hopefully
avoids the mysterious crashes.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Rick Walsh 2016-02-01 21:29:50 +11:00 committed by Dirk Hohndel
parent 448abec769
commit fdd5ee507c

View file

@ -72,8 +72,14 @@ Item {
} }
MobileComponents.Label { MobileComponents.Label {
text: dive.date + " " + dive.time text: dive.date + " " + dive.time
Layout.minimumWidth: Math.max(MobileComponents.Units.gridUnit * 4, paintedWidth) // helps vertical alignment throughout listview wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Layout.columnSpan: 3 Layout.columnSpan: 2
}
MobileComponents.Label {
id: numberText
text: "#" + dive.number
color: MobileComponents.Theme.textColor
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
} }
MobileComponents.Label { MobileComponents.Label {
@ -84,26 +90,16 @@ Item {
} }
MobileComponents.Label { MobileComponents.Label {
text: dive.depth text: dive.depth
Layout.minimumWidth: Math.max(MobileComponents.Units.gridUnit * 4, paintedWidth) // helps vertical alignment throughout listview
} }
MobileComponents.Label { MobileComponents.Label {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: "Duration: " text: "Duration: "
opacity: 0.6 opacity: 0.6
} }
RowLayout {
MobileComponents.Label { MobileComponents.Label {
text: dive.duration text: dive.duration
} wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
Item {
Layout.fillWidth: true Layout.fillWidth: true
height: parent.height
}
MobileComponents.Label {
id: numberText
text: "#" + dive.number
color: MobileComponents.Theme.textColor
}
} }
QMLProfile { QMLProfile {