Mobile: improve GFLow/High settings UI

- move the spinbox closer to the senter
- improve sizing and spacing of the spinbox
- hide it when we aren't showing the calculated ceiling

Also address an odd whitespace issue.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2024-02-12 17:26:14 -08:00 committed by Michael Keller
parent 31d1755efd
commit 704b26ff1e
2 changed files with 42 additions and 31 deletions

View file

@ -536,11 +536,11 @@ TemplatePage {
GridLayout { GridLayout {
visible: sectionAdvanced.isExpanded visible: sectionAdvanced.isExpanded
width: parent.width width: parent.width
columns: 2 columns: 3
TemplateLine { TemplateLine {
visible: sectionAdvanced.isExpanded visible: sectionAdvanced.isExpanded
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Bluetooth") text: qsTr("Bluetooth")
@ -548,11 +548,12 @@ TemplatePage {
font.weight: Font.Light font.weight: Font.Light
Layout.topMargin: Kirigami.Units.largeSpacing Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Temporarily show all bluetooth devices \neven if not recognized as dive computers.\nPlease report DCs that need this setting") text: qsTr("Temporarily show all bluetooth devices \neven if not recognized as dive computers.\nPlease report DCs that need this setting")
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2
} }
SsrfSwitch { SsrfSwitch {
id: nonDCButton id: nonDCButton
@ -564,7 +565,7 @@ TemplatePage {
TemplateLine { TemplateLine {
visible: sectionAdvanced.isExpanded visible: sectionAdvanced.isExpanded
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Display") text: qsTr("Display")
@ -572,11 +573,12 @@ TemplatePage {
font.weight: Font.Light font.weight: Font.Light
Layout.topMargin: Kirigami.Units.largeSpacing Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Show only one column in Portrait mode") text: qsTr("Show only one column in Portrait mode")
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2
} }
SsrfSwitch { SsrfSwitch {
id: singleColumnButton id: singleColumnButton
@ -587,6 +589,7 @@ TemplatePage {
} }
TemplateLabel { TemplateLabel {
text: qsTr("Depth line based on ×3 intervals") text: qsTr("Depth line based on ×3 intervals")
Layout.columnSpan: 2
} }
SsrfSwitch { SsrfSwitch {
checked: PrefDisplay.three_m_based_grid checked: PrefDisplay.three_m_based_grid
@ -597,7 +600,7 @@ TemplatePage {
} }
TemplateLine { TemplateLine {
visible: sectionAdvanced.isExpanded visible: sectionAdvanced.isExpanded
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Profile deco ceiling") text: qsTr("Profile deco ceiling")
@ -605,10 +608,11 @@ TemplatePage {
font.weight: Font.Light font.weight: Font.Light
Layout.topMargin: Kirigami.Units.largeSpacing Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Show DC reported ceiling") text: qsTr("Show DC reported ceiling")
Layout.columnSpan: 2
} }
SsrfSwitch { SsrfSwitch {
checked: PrefTechnicalDetails.dcceiling checked: PrefTechnicalDetails.dcceiling
@ -619,6 +623,7 @@ TemplatePage {
} }
TemplateLabel { TemplateLabel {
text: qsTr("Show calculated ceiling") text: qsTr("Show calculated ceiling")
Layout.columnSpan: 2
} }
SsrfSwitch { SsrfSwitch {
checked: PrefTechnicalDetails.calcceiling checked: PrefTechnicalDetails.calcceiling
@ -628,12 +633,14 @@ TemplatePage {
} }
} }
TemplateLabel { TemplateLabel {
enabled: PrefTechnicalDetails.calcceiling visible: PrefTechnicalDetails.calcceiling
text: qsTr("GFLow") text: qsTr("GFLow")
} }
TemplateSpinBox { TemplateSpinBox {
enabled: PrefTechnicalDetails.calcceiling visible: PrefTechnicalDetails.calcceiling
id: gfLow id: gfLow
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
from: 10 from: 10
to: 150 to: 150
stepSize: 1 stepSize: 1
@ -647,12 +654,14 @@ TemplatePage {
} }
} }
TemplateLabel { TemplateLabel {
enabled: PrefTechnicalDetails.calcceiling visible: PrefTechnicalDetails.calcceiling
text: qsTr("GFHigh") text: qsTr("GFHigh")
} }
TemplateSpinBox { TemplateSpinBox {
enabled: PrefTechnicalDetails.calcceiling visible: PrefTechnicalDetails.calcceiling
id: gfHigh id: gfHigh
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
from: 10 from: 10
to: 150 to: 150
stepSize: 1 stepSize: 1
@ -667,7 +676,7 @@ TemplatePage {
} }
TemplateLine { TemplateLine {
visible: sectionAdvanced.isExpanded visible: sectionAdvanced.isExpanded
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Developer") text: qsTr("Developer")
@ -675,11 +684,12 @@ TemplatePage {
font.weight: Font.Light font.weight: Font.Light
Layout.topMargin: Kirigami.Units.largeSpacing Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
Layout.columnSpan: 2 Layout.columnSpan: 3
} }
TemplateLabel { TemplateLabel {
text: qsTr("Display Developer menu") text: qsTr("Display Developer menu")
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2
} }
SsrfSwitch { SsrfSwitch {
id: developerButton id: developerButton

View file

@ -12,6 +12,7 @@ SpinBox {
contentItem: TextInput { contentItem: TextInput {
z: 2 z: 2
width: Kirigami.Units.gridUnit * 3
text: control.textFromValue(control.value, control.locale) text: control.textFromValue(control.value, control.locale)
font: control.font font: control.font
color: control.enabled ? subsurfaceTheme.textColor : subsurfaceTheme.disabledTextColor color: control.enabled ? subsurfaceTheme.textColor : subsurfaceTheme.disabledTextColor
@ -25,14 +26,14 @@ SpinBox {
up.indicator: Rectangle { up.indicator: Rectangle {
x: control.mirrored ? 0 : parent.width - width x: control.mirrored ? 0 : parent.width - width
height: Kirigami.Units.gridUnit * 2 height: Kirigami.Units.gridUnit * 1.5
implicitWidth: Kirigami.Units.gridUnit * 1.5 implicitWidth: Kirigami.Units.gridUnit
implicitHeight: Kirigami.Units.gridUnit * 1.5 implicitHeight: Kirigami.Units.gridUnit
color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
Text { Text {
text: "+" text: "+"
font.pixelSize: control.font.pixelSize * 2 font.pixelSize: control.font.pixelSize * 1.5
color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor
anchors.fill: parent anchors.fill: parent
fontSizeMode: Text.Fit fontSizeMode: Text.Fit
@ -43,14 +44,14 @@ SpinBox {
down.indicator: Rectangle { down.indicator: Rectangle {
x: control.mirrored ? parent.width - width : 0 x: control.mirrored ? parent.width - width : 0
height: Kirigami.Units.gridUnit * 2 height: Kirigami.Units.gridUnit * 1.5
implicitWidth: Kirigami.Units.gridUnit * 1.5 implicitWidth: Kirigami.Units.gridUnit
implicitHeight: Kirigami.Units.gridUnit * 1.5 implicitHeight: Kirigami.Units.gridUnit
color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor
Text { Text {
text: "-" text: "-"
font.pixelSize: control.font.pixelSize * 2 font.pixelSize: control.font.pixelSize * 1.5
color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor
anchors.fill: parent anchors.fill: parent
fontSizeMode: Text.Fit fontSizeMode: Text.Fit