mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
d8d9301e8e
commit
e174389618
1 changed files with 16 additions and 9 deletions
|
@ -12,8 +12,8 @@ import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||||
Item {
|
Item {
|
||||||
id: detailsView
|
id: detailsView
|
||||||
property int labelWidth: MobileComponents.Units.gridUnit * 10
|
property int labelWidth: MobileComponents.Units.gridUnit * 10
|
||||||
width: parent.width
|
width: SubsurfaceTheme.columnWidth
|
||||||
height: mainLayout.implicitHeight + MobileComponents.Units.iconSizes.large
|
height: mainLayout.implicitHeight + bottomLayout.implicitHeight + MobileComponents.Units.iconSizes.large
|
||||||
Rectangle {
|
Rectangle {
|
||||||
z: 99
|
z: 99
|
||||||
color: MobileComponents.Theme.textColor
|
color: MobileComponents.Theme.textColor
|
||||||
|
@ -90,6 +90,8 @@ Item {
|
||||||
}
|
}
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
text: dive.depth
|
text: dive.depth
|
||||||
|
Layout.fillWidth: true
|
||||||
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
|
@ -99,7 +101,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
text: dive.duration
|
text: dive.duration
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QMLProfile {
|
QMLProfile {
|
||||||
|
@ -118,6 +119,18 @@ Item {
|
||||||
anchors.fill: parent
|
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 {
|
MobileComponents.Heading {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -146,7 +159,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
id: txtWaterTemp
|
id: txtWaterTemp
|
||||||
text: dive.waterTemp
|
text: dive.waterTemp
|
||||||
Layout.fillWidth: true
|
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +170,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
id: txtSuit
|
id: txtSuit
|
||||||
text: dive.suit
|
text: dive.suit
|
||||||
Layout.fillWidth: true
|
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +181,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
id: txtWeight
|
id: txtWeight
|
||||||
text: dive.sumWeight
|
text: dive.sumWeight
|
||||||
Layout.fillWidth: true
|
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +192,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
id: txtCylinder
|
id: txtCylinder
|
||||||
text: dive.getCylinder
|
text: dive.getCylinder
|
||||||
Layout.fillWidth: true
|
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +203,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
id: txtDiveMaster
|
id: txtDiveMaster
|
||||||
text: dive.divemaster
|
text: dive.divemaster
|
||||||
Layout.fillWidth: true
|
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +214,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
id: txtBuddy
|
id: txtBuddy
|
||||||
text: dive.buddy
|
text: dive.buddy
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue