diff options
author | Sebastian Kügler <sebas@kde.org> | 2015-12-08 03:11:19 +0100 |
---|---|---|
committer | Sebastian Kügler <sebas@kde.org> | 2015-12-08 04:55:56 +0100 |
commit | 339ff4f2591d41edbab7209ce3d03bf1bd8c8589 (patch) | |
tree | 38347ed3f400b3a45e0bdfd7bdc564f4fe53d959 /qt-mobile | |
parent | 531eace0c3b00c110392a52d61a594107f3dafcf (diff) | |
download | subsurface-339ff4f2591d41edbab7209ce3d03bf1bd8c8589.tar.gz |
Fix page margins in preferences and cloudcredentials
- page margins are gridUnit / 2, consistent with other pages
- Simplify layout: we don't need to nest that much here, saves two
objects and simplifies code a bit
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qml/CloudCredentials.qml | 7 | ||||
-rw-r--r-- | qt-mobile/qml/Preferences.qml | 107 |
2 files changed, 59 insertions, 55 deletions
diff --git a/qt-mobile/qml/CloudCredentials.qml b/qt-mobile/qml/CloudCredentials.qml index aa85f1fa5..cd82444fc 100644 --- a/qt-mobile/qml/CloudCredentials.qml +++ b/qt-mobile/qml/CloudCredentials.qml @@ -16,8 +16,11 @@ Item { property bool issave: savePassword.checked; ColumnLayout { - anchors.fill: parent - anchors.margins: MobileComponents.Units.gridUnit + + anchors { + fill: parent + margins: MobileComponents.Units.gridUnit / 2 + } MobileComponents.Heading { text: "Cloud credentials" diff --git a/qt-mobile/qml/Preferences.qml b/qt-mobile/qml/Preferences.qml index 4531bc902..8ce739e4a 100644 --- a/qt-mobile/qml/Preferences.qml +++ b/qt-mobile/qml/Preferences.qml @@ -6,71 +6,72 @@ import QtQuick.Layouts 1.1 import org.kde.plasma.mobilecomponents 0.2 as MobileComponents import org.subsurfacedivelog.mobile 1.0 -Item { - id: preferencesWindow + +GridLayout { signal accept - GridLayout { - columns: 2 - anchors.fill: parent - anchors.margins: MobileComponents.Units.gridUnit + columns: 2 + width: parent.width - MobileComponents.Units.gridUnit + anchors { + fill: parent + margins: MobileComponents.Units.gridUnit / 2 + } - MobileComponents.Heading { - text: "Preferences" - Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2 - Layout.columnSpan: 2 - } + MobileComponents.Heading { + text: "Preferences" + Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2 + Layout.columnSpan: 2 + } - MobileComponents.Heading { - text: "Subsurface GPS data webservice" - level: 3 - Layout.topMargin: MobileComponents.Units.largeSpacing - Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2 - Layout.columnSpan: 2 - } + MobileComponents.Heading { + text: "Subsurface GPS data webservice" + level: 3 + Layout.topMargin: MobileComponents.Units.largeSpacing + Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2 + Layout.columnSpan: 2 + } - MobileComponents.Label { - text: "Distance threshold (meters)" - Layout.alignment: Qt.AlignRight - } + MobileComponents.Label { + text: "Distance threshold (meters)" + Layout.alignment: Qt.AlignRight + } - TextField { - id: distanceThreshold - text: manager.distanceThreshold - Layout.fillWidth: true - } + TextField { + id: distanceThreshold + text: manager.distanceThreshold + Layout.fillWidth: true + } - MobileComponents.Label { - text: "Time threshold (minutes)" - Layout.alignment: Qt.AlignRight - } + MobileComponents.Label { + text: "Time threshold (minutes)" + Layout.alignment: Qt.AlignRight + } - TextField { - id: timeThreshold - text: manager.timeThreshold - Layout.fillWidth: true - } + TextField { + id: timeThreshold + text: manager.timeThreshold + Layout.fillWidth: true + } - Item { width: MobileComponents.Units.gridUnit; height: width } - Item { - height: saveButton.height - width: saveButton.width - Button { - id: saveButton - text: "Save" - anchors.centerIn: parent - onClicked: { - manager.distanceThreshold = distanceThreshold.text - manager.timeThreshold = timeThreshold.text - manager.savePreferences() - stackView.pop() - } + Item { width: MobileComponents.Units.gridUnit; height: width } + Item { + height: saveButton.height + width: saveButton.width + Button { + id: saveButton + text: "Save" + anchors.centerIn: parent + onClicked: { + manager.distanceThreshold = distanceThreshold.text + manager.timeThreshold = timeThreshold.text + manager.savePreferences() + stackView.pop() } } + } - Item { - Layout.fillHeight: true - } + Item { + Layout.fillHeight: true } } |