diff options
author | Marco Martin <notmart@gmail.com> | 2016-05-02 16:48:03 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-05-02 10:40:48 -0700 |
commit | 029b524f37548ab9b10efa84a822ccd123ee7d9e (patch) | |
tree | d32140e91b9b84651a69cd49f1fe242d8a2c54ad /mobile-widgets | |
parent | 304af311f0a341ccbc1da1ca85a2847f592be4d9 (diff) | |
download | subsurface-029b524f37548ab9b10efa84a822ccd123ee7d9e.tar.gz |
Make the last column take all the available size
The grid layout had each column fixed to a width
taken as a portion of the grid width, but since
the grid has a columnSpacing defined as well,
the computation doesn't add up, helping in causing
an infinite recursion problem in the attempt of
sizing and positioning all the children of the layout
[Dirk Hohndel: heavily modified, but the basic idea remains]
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DiveDetailsView.qml | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index 04121cacc..557286f7f 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -18,7 +18,7 @@ Item { property real col4Width: gridWidth * 0.20 width: diveDetailsPage.width - diveDetailsPage.leftPadding - diveDetailsPage.rightPadding - height: mainLayout.implicitHeight + bottomLayout.implicitHeight + Kirigami.Units.iconSizes.large + height: mainLayout.implicitHeight + bottomLayout.implicitHeight + bottomLayout2.implicitHeight + Kirigami.Units.iconSizes.large Rectangle { z: 99 color: Kirigami.Theme.textColor @@ -145,15 +145,14 @@ Item { wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col1Width - Layout.preferredWidth: detailsView.col1Width + Layout.minimumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtSuit text: dive.suit wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.maximumWidth: detailsView.col2Width - Layout.preferredWidth: detailsView.col2Width + Layout.fillWidth: true } Kirigami.Label { @@ -161,7 +160,7 @@ Item { wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col3Width - Layout.preferredWidth: detailsView.col3Width + Layout.minimumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { @@ -169,22 +168,21 @@ Item { text: dive.airTemp wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere Layout.maximumWidth: detailsView.col4Width - Layout.preferredWidth: detailsView.col4Width + Layout.minimumWidth: detailsView.col4Width } Kirigami.Label { text: "Cylinder:" opacity: 0.6 Layout.maximumWidth: detailsView.col1Width - Layout.preferredWidth: detailsView.col1Width + Layout.minimumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtCylinder text: dive.getCylinder wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.maximumWidth: detailsView.col2Width - Layout.preferredWidth: detailsView.col2Width + Layout.fillWidth: true } Kirigami.Label { @@ -192,7 +190,7 @@ Item { wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col3Width - Layout.preferredWidth: detailsView.col3Width + Layout.minimumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { @@ -200,7 +198,7 @@ Item { text: dive.waterTemp wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere Layout.maximumWidth: detailsView.col4Width - Layout.preferredWidth: detailsView.col4Width + Layout.minimumWidth: detailsView.col4Width } Kirigami.Label { @@ -208,22 +206,21 @@ Item { wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 Layout.maximumWidth: detailsView.col1Width - Layout.preferredWidth: detailsView.col1Width + Layout.minimumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtDiveMaster text: dive.divemaster wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.maximumWidth: detailsView.col2Width - Layout.preferredWidth: detailsView.col2Width + Layout.fillWidth: true } Kirigami.Label { text: "Weight:" opacity: 0.6 Layout.maximumWidth: detailsView.col3Width - Layout.preferredWidth: detailsView.col3Width + Layout.minimumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { @@ -231,7 +228,7 @@ Item { text: dive.sumWeight wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere Layout.maximumWidth: detailsView.col4Width - Layout.preferredWidth: detailsView.col4Width + Layout.minimumWidth: detailsView.col4Width } } // clearly, Qt 5.6.0 is buggy as having this as one GridLayout @@ -252,22 +249,21 @@ Item { text: "Buddy:" opacity: 0.6 Layout.maximumWidth: detailsView.col1Width - Layout.preferredWidth: detailsView.col1Width + Layout.minimumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtBuddy text: dive.buddy wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.maximumWidth: detailsView.col2Width - Layout.preferredWidth: detailsView.col2Width + Layout.fillWidth: true } Kirigami.Label { text: "SAC:" opacity: 0.6 Layout.maximumWidth: detailsView.col3Width - Layout.preferredWidth: detailsView.col3Width + Layout.minimumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { @@ -275,7 +271,7 @@ Item { text: dive.sac wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere Layout.maximumWidth: detailsView.col4Width - Layout.preferredWidth: detailsView.col4Width + Layout.minimumWidth: detailsView.col4Width } Kirigami.Heading { @@ -292,7 +288,6 @@ Item { focus: true Layout.columnSpan: 4 Layout.fillWidth: true - Layout.fillHeight: true //selectByMouse: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } |