aboutsummaryrefslogtreecommitdiff
path: root/src/SettingsPage.qml
diff options
context:
space:
mode:
authorArseniy Movshev <dodoradio@outlook.com>2023-05-28 13:51:45 +0100
committerArseniy Movshev <dodoradio@outlook.com>2023-05-28 14:22:20 +0100
commite860240c09c2f4474780823fc9711a64881127f5 (patch)
tree287ee6f73972b5471ff88433d50d8c5329309ceb /src/SettingsPage.qml
parent6a21341fa5d120c0642ba67a19f81f852f0c16bb (diff)
Add settings page
This page currently only allows enabling/disabling the two currently supported sensors This also necessitated the addition of a layerstack to allow layer navigation
Diffstat (limited to '')
-rw-r--r--src/SettingsPage.qml21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/SettingsPage.qml b/src/SettingsPage.qml
index 5cc32b1..600017e 100644
--- a/src/SettingsPage.qml
+++ b/src/SettingsPage.qml
@@ -35,26 +35,29 @@ Item {
Item { width: parent.width; height: parent.width*0.2}
LabeledSwitch {
+ id: stepsEnableSwitch
width: parent.width
height: width*0.25
text: "Log step count"
- onCheckedChanged: loggerSettings.stepCounterEnabled = checked
- checked: loggerSettings.stepCounterEnabled
+ Component.onCompleted: checked = loggerSettings.stepCounterEnabled
}
LabeledSwitch {
id: hrEnableSwitch
width: parent.width
height: width*0.25
text: "Log heart rate"
- onCheckedChanged: loggerSettings.heartrateSensorEnabled = checked
- checked: loggerSettings.heartrateSensorEnabled
+ Component.onCompleted: checked = loggerSettings.heartrateSensorEnabled
}
- LabeledActionButton {
- text: "reload dbus"
- width: parent.width
- height: width*0.25
+ IconButton {
+ iconName: "ios-checkmark-circle-outline"
+ height: parent.width*0.2
+ width: height
+ anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
- hrEnableSwitch.checked = loggerSettings.heartrateSensorEnabled
+ loggerSettings.stepCounterEnabled = stepsEnableSwitch.checked
+ loggerSettings.heartrateSensorEnabled = hrEnableSwitch.checked
+ loggerSettings.reInitLogger()
+ pageStack.pop(pageStack.currentLayer)
}
}
}