aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-07 12:41:24 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-07 12:45:36 -0800
commite1743896185dc0313ccac8aa5c8d58abf1cc2b62 (patch)
treea9aeee1a850b6bacb267d71fe5597c225a3b9308 /qt-mobile
parentd8d9301e8ea0627b52a693b2e48defdd96ec51bf (diff)
downloadsubsurface-e1743896185dc0313ccac8aa5c8d58abf1cc2b62.tar.gz
QML UI: another attempt to fix the random crashes
I finally was able to reproduce the crashes with the infinite recursion when computing a GridLayout. This seems to be triggered by competing Layout.fillWidth settings that the layout engine couldn't figure out how to accomodate. I did three things to make this work better: - explicitly grab the columnWidth for the width of the DiveDetailsView. - split the GridLayout in two so the area above and below the profile are no longer forced to fit in the same column widths. - remove most of the Layout.fillWidth settings and only leave a couple that seem sufficient to get reasonable on screen layout in my experiments. Here's hoping that this one is finally resolved. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qml/DiveDetailsView.qml25
1 files changed, 16 insertions, 9 deletions
diff --git a/qt-mobile/qml/DiveDetailsView.qml b/qt-mobile/qml/DiveDetailsView.qml
index e3fe59416..e8e2f0f07 100644
--- a/qt-mobile/qml/DiveDetailsView.qml
+++ b/qt-mobile/qml/DiveDetailsView.qml
@@ -12,8 +12,8 @@ import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
Item {
id: detailsView
property int labelWidth: MobileComponents.Units.gridUnit * 10
- width: parent.width
- height: mainLayout.implicitHeight + MobileComponents.Units.iconSizes.large
+ width: SubsurfaceTheme.columnWidth
+ height: mainLayout.implicitHeight + bottomLayout.implicitHeight + MobileComponents.Units.iconSizes.large
Rectangle {
z: 99
color: MobileComponents.Theme.textColor
@@ -90,6 +90,8 @@ Item {
}
MobileComponents.Label {
text: dive.depth
+ Layout.fillWidth: true
+ wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
MobileComponents.Label {
Layout.alignment: Qt.AlignRight
@@ -99,7 +101,6 @@ Item {
MobileComponents.Label {
text: dive.duration
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
- Layout.fillWidth: true
}
QMLProfile {
@@ -118,6 +119,18 @@ Item {
anchors.fill: parent
}
}
+ }
+ GridLayout {
+ id: bottomLayout
+ anchors {
+ top: mainLayout.bottom
+ left: parent.left
+ right: parent.right
+ margins: MobileComponents.Units.gridUnit
+ }
+ columns: 4
+ rowSpacing: MobileComponents.Units.smallSpacing * 2
+ columnSpacing: MobileComponents.Units.smallSpacing
MobileComponents.Heading {
Layout.fillWidth: true
@@ -146,7 +159,6 @@ Item {
MobileComponents.Label {
id: txtWaterTemp
text: dive.waterTemp
- Layout.fillWidth: true
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
@@ -158,7 +170,6 @@ Item {
MobileComponents.Label {
id: txtSuit
text: dive.suit
- Layout.fillWidth: true
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
@@ -170,7 +181,6 @@ Item {
MobileComponents.Label {
id: txtWeight
text: dive.sumWeight
- Layout.fillWidth: true
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
@@ -182,7 +192,6 @@ Item {
MobileComponents.Label {
id: txtCylinder
text: dive.getCylinder
- Layout.fillWidth: true
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
@@ -194,7 +203,6 @@ Item {
MobileComponents.Label {
id: txtDiveMaster
text: dive.divemaster
- Layout.fillWidth: true
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}
@@ -206,7 +214,6 @@ Item {
MobileComponents.Label {
id: txtBuddy
text: dive.buddy
- Layout.fillWidth: true
Layout.columnSpan: 3
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
}