mobile, QML UI: ssrfButton and download controls resizable

Make the ssrfButton and the pull down menu's on the download page
resizable. Notice that also the contents of the pulldown
menu's is scaled based on the font size.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2018-09-25 19:58:12 +02:00 committed by Dirk Hohndel
parent f6ee900826
commit be1d3a7986
2 changed files with 19 additions and 4 deletions

View file

@ -55,14 +55,19 @@ Kirigami.Page {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
Layout.topMargin: Kirigami.Units.smallSpacing * 4 Layout.topMargin: Kirigami.Units.smallSpacing * 4
columns: 2 columns: 2
Controls.Label { text: qsTr(" Vendor name: ") } Controls.Label {
text: qsTr(" Vendor name: ")
font.pointSize: subsurfaceTheme.regularPointSize
}
Controls.ComboBox { Controls.ComboBox {
id: comboVendor id: comboVendor
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: fontMetrics.height * 2.5
model: vendorList model: vendorList
currentIndex: -1 currentIndex: -1
delegate: Controls.ItemDelegate { delegate: Controls.ItemDelegate {
width: comboVendor.width width: comboVendor.width
height: fontMetrics.height * 2.0
contentItem: Text { contentItem: Text {
text: modelData text: modelData
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
@ -92,14 +97,19 @@ Kirigami.Page {
} }
} }
} }
Controls.Label { text: qsTr(" Dive Computer:") } Controls.Label {
text: qsTr(" Dive Computer:")
font.pointSize: subsurfaceTheme.regularPointSize
}
Controls.ComboBox { Controls.ComboBox {
id: comboProduct id: comboProduct
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: fontMetrics.height * 2.5
model: null model: null
currentIndex: -1 currentIndex: -1
delegate: Controls.ItemDelegate { delegate: Controls.ItemDelegate {
width: comboProduct.width width: comboProduct.width
height: fontMetrics.height * 2.0
contentItem: Text { contentItem: Text {
text: modelData text: modelData
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
@ -127,17 +137,21 @@ Kirigami.Page {
currentIndex = manager.getDetectedProductIndex(comboVendor.currentText) currentIndex = manager.getDetectedProductIndex(comboVendor.currentText)
} }
} }
Controls.Label { text: qsTr(" Connection:") } Controls.Label {
text: qsTr(" Connection:")
font.pointSize: subsurfaceTheme.regularPointSize
}
Controls.ComboBox { Controls.ComboBox {
id: comboConnection id: comboConnection
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: fontMetrics.height * 2.5
model: connectionListModel model: connectionListModel
currentIndex: -1 currentIndex: -1
delegate: Controls.ItemDelegate { delegate: Controls.ItemDelegate {
width: comboConnection.width width: comboConnection.width
height: fontMetrics.height * 2.0
contentItem: Text { contentItem: Text {
text: modelData text: modelData
// color: "#21be2b"
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight elide: Text.ElideRight

View file

@ -15,6 +15,7 @@ Button {
contentItem: Text { contentItem: Text {
id: buttonText id: buttonText
text: root.text text: root.text
font.pointSize: subsurfaceTheme.regularPointSize
anchors.centerIn: buttonBackground anchors.centerIn: buttonBackground
color: root.pressed ? subsurfaceTheme.darkerPrimaryTextColor :subsurfaceTheme.primaryTextColor color: root.pressed ? subsurfaceTheme.darkerPrimaryTextColor :subsurfaceTheme.primaryTextColor
} }