From f99aedc6265122444a847b7585ed12ec9e779868 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 9 Apr 2017 21:12:39 -0700 Subject: QML UI: correctly set grid column widths Spending more time reading the documentation, we need to set the Layout.maximumWidth, not the width. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetailsView.qml | 55 ++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 25 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index e0069b04a..a7d466c0b 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -140,108 +140,114 @@ Item { Kirigami.Label { text: qsTr("Suit:") - wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 - width: detailsView.col1Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtSuit text: dive.suit wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.fillWidth: true + Layout.maximumWidth: detailsView.col2Width } Kirigami.Label { text: qsTr("Air Temp:") - wrapMode: Text.WrapAtWordBoundaryOrAnywhere opacity: 0.6 - width: detailsView.col3Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtAirTemp text: dive.airTemp - wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - width: detailsView.col4Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col4Width } Kirigami.Label { text: qsTr("Cylinder:") opacity: 0.6 - width: detailsView.col1Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtCylinder text: dive.getCylinder - wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.fillWidth: true + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col2Width } Kirigami.Label { text: qsTr("Water Temp:") opacity: 0.6 - width: detailsView.col3Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtWaterTemp text: dive.waterTemp - wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - width: detailsView.col4Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col4Width } Kirigami.Label { text: qsTr("Divemaster:") opacity: 0.6 - width: detailsView.col1Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtDiveMaster text: dive.divemaster wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.fillWidth: true + Layout.maximumWidth: detailsView.col2Width } Kirigami.Label { text: qsTr("Weight:") opacity: 0.6 - width: detailsView.col3Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtWeight text: dive.sumWeight - wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - width: detailsView.col4Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col4Width } Kirigami.Label { text: qsTr("Buddy:") opacity: 0.6 - width: detailsView.col1Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col1Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtBuddy text: dive.buddy - wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - Layout.fillWidth: true + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col2Width } Kirigami.Label { text: qsTr("SAC:") opacity: 0.6 - width: detailsView.col3Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col3Width Layout.alignment: Qt.AlignRight } Kirigami.Label { id: txtSAC text: dive.sac - wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere - width: detailsView.col4Width + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + Layout.maximumWidth: detailsView.col4Width } Kirigami.Heading { @@ -258,7 +264,6 @@ Item { focus: true Layout.columnSpan: 4 Layout.fillWidth: true - //selectByMouse: true wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere } Item { -- cgit v1.2.3-70-g09d2