mobile, QML UI: margings and paddings in download screen

There was a significant of not needed whitespace on the download from
DC page. Most importantly, the bottom buttons where not on the bottom,
so we had to truncate the downloaded dives early (to prevent overflowing
the buttons). Further, a tiny bit of padding is removed between the
3 top pull down items.

All this, results in the diplay of more dives without scrolling.
For example, previously, only 1 dive (with 1 stored DC) was shown
on my 5.5" device, and now 3 (scale: regular).

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2018-09-26 14:57:12 +02:00 committed by Dirk Hohndel
parent 8ab8a67f81
commit 97031da0d8

View file

@ -9,10 +9,10 @@ import org.kde.kirigami 2.2 as Kirigami
Kirigami.Page { Kirigami.Page {
id: diveComputerDownloadWindow id: diveComputerDownloadWindow
anchors.top:parent.top leftPadding: Kirigami.Units.gridUnit / 2
width: parent.width rightPadding: Kirigami.Units.gridUnit / 2
height: parent.height topPadding: 0
Layout.fillWidth: true; bottomPadding: 0
title: qsTr("Dive Computer") title: qsTr("Dive Computer")
background: Rectangle { color: subsurfaceTheme.backgroundColor } background: Rectangle { color: subsurfaceTheme.backgroundColor }
@ -49,12 +49,12 @@ Kirigami.Page {
anchors.top: parent.top anchors.top: parent.top
height: parent.height height: parent.height
width: parent.width width: parent.width
Layout.fillWidth: true
GridLayout { GridLayout {
id: buttonGrid id: buttonGrid
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
Layout.topMargin: Kirigami.Units.smallSpacing * 4 Layout.topMargin: Kirigami.Units.smallSpacing * 4
columns: 2 columns: 2
rowSpacing: 0
Controls.Label { Controls.Label {
text: qsTr(" Vendor name: ") text: qsTr(" Vendor name: ")
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
@ -313,7 +313,7 @@ Kirigami.Page {
ListView { ListView {
id: dlList id: dlList
Layout.topMargin: Kirigami.Units.smallSpacing * 4 Layout.topMargin: Kirigami.Units.smallSpacing * 4
Layout.bottomMargin: bottomButtons.height * 1.5 Layout.bottomMargin: bottomButtons.height / 2
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
@ -334,7 +334,6 @@ Kirigami.Page {
RowLayout { RowLayout {
id: bottomButtons id: bottomButtons
Layout.fillWidth: true
Controls.Label { Controls.Label {
text: "" // Spacer on the left for hamburger menu text: "" // Spacer on the left for hamburger menu
Layout.fillWidth: true Layout.fillWidth: true
@ -343,6 +342,7 @@ Kirigami.Page {
id: acceptButton id: acceptButton
enabled: divesDownloaded enabled: divesDownloaded
text: qsTr("Accept") text: qsTr("Accept")
bottomPadding: Kirigami.Units.gridUnit / 2
onClicked: { onClicked: {
manager.appendTextToLog("Save downloaded dives that were selected") manager.appendTextToLog("Save downloaded dives that were selected")
importModel.recordDives() importModel.recordDives()
@ -362,6 +362,7 @@ Kirigami.Page {
id: select id: select
enabled: divesDownloaded enabled: divesDownloaded
text: qsTr("Select All") text: qsTr("Select All")
bottomPadding: Kirigami.Units.gridUnit / 2
onClicked : { onClicked : {
importModel.selectAll() importModel.selectAll()
} }
@ -370,6 +371,7 @@ Kirigami.Page {
id: unselect id: unselect
enabled: divesDownloaded enabled: divesDownloaded
text: qsTr("Unselect All") text: qsTr("Unselect All")
bottomPadding: Kirigami.Units.gridUnit / 2
onClicked : { onClicked : {
importModel.selectNone() importModel.selectNone()
} }