mobile/UI: make dive download combo boxes theme aware

In reality I should make our TemplateComboBox capable of handling the
modifications needed here without yet another reimplementation. Maybe
I'll do that next. This at least makes things look right.

A couple of odd whitespace changes snuck in at the end.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-12-20 17:18:47 -08:00
parent 535a15e5fd
commit 4995c141c6

View file

@ -54,7 +54,7 @@ Kirigami.Page {
TemplateLabel { TemplateLabel {
text: qsTr(" Vendor name: ") text: qsTr(" Vendor name: ")
} }
Controls.ComboBox { TemplateComboBox {
id: comboVendor id: comboVendor
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5 Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
@ -66,6 +66,7 @@ Kirigami.Page {
contentItem: Text { contentItem: Text {
text: modelData text: modelData
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -74,6 +75,7 @@ Kirigami.Page {
contentItem: Text { contentItem: Text {
text: comboVendor.displayText text: comboVendor.displayText
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
color: subsurfaceTheme.textColor
leftPadding: Kirigami.Units.gridUnit * 0.5 leftPadding: Kirigami.Units.gridUnit * 0.5
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@ -90,7 +92,7 @@ Kirigami.Page {
TemplateLabel { TemplateLabel {
text: qsTr(" Dive Computer:") text: qsTr(" Dive Computer:")
} }
Controls.ComboBox { TemplateComboBox {
id: comboProduct id: comboProduct
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5 Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
@ -102,6 +104,7 @@ Kirigami.Page {
contentItem: Text { contentItem: Text {
text: modelData text: modelData
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -110,6 +113,7 @@ Kirigami.Page {
contentItem: Text { contentItem: Text {
text: comboProduct.displayText text: comboProduct.displayText
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
color: subsurfaceTheme.textColor
leftPadding: Kirigami.Units.gridUnit * 0.5 leftPadding: Kirigami.Units.gridUnit * 0.5
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@ -129,7 +133,7 @@ Kirigami.Page {
TemplateLabel { TemplateLabel {
text: qsTr(" Connection:") text: qsTr(" Connection:")
} }
Controls.ComboBox { TemplateComboBox {
id: comboConnection id: comboConnection
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5 Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
@ -141,6 +145,7 @@ Kirigami.Page {
contentItem: Text { contentItem: Text {
text: modelData text: modelData
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -149,6 +154,7 @@ Kirigami.Page {
contentItem: Text { contentItem: Text {
text: comboConnection.displayText text: comboConnection.displayText
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.textColor
leftPadding: Kirigami.Units.gridUnit * 0.5 leftPadding: Kirigami.Units.gridUnit * 0.5
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@ -171,7 +177,7 @@ Kirigami.Page {
dc1.enabled = dc2.enabled = dc3.enabled = dc4.enabled = true dc1.enabled = dc2.enabled = dc3.enabled = dc4.enabled = true
for (var i = 1; i < 5; i++) { for (var i = 1; i < 5; i++) {
switch (i) { switch (i) {
case 1: case 1:
curVendor = PrefDiveComputer.vendor1 curVendor = PrefDiveComputer.vendor1
curProduct = PrefDiveComputer.product1 curProduct = PrefDiveComputer.product1
curDevice = PrefDiveComputer.device1 curDevice = PrefDiveComputer.device1
@ -233,7 +239,7 @@ Kirigami.Page {
} }
function disableDC(inx) { function disableDC(inx) {
switch (inx) { switch (inx) {
case 1: case 1:
dc1.enabled = false dc1.enabled = false
break; break;
case 2: case 2: