diff options
author | dodoradio <dodoradio@outlook.com> | 2023-07-21 15:54:21 +0100 |
---|---|---|
committer | dodoradio <dodoradio@outlook.com> | 2023-07-21 16:51:09 +0100 |
commit | 86ac8fec062c9dfb6d695ac5c82bb06241f0ab13 (patch) | |
tree | d3bf83d6f52c5f649fa3effb004ee04ba44bba11 /src | |
parent | ec655ab2d3a0c02af0a451e8862355ecd700671e (diff) |
Steps: Use new bar graph interactions to open detail page at different dates
Diffstat (limited to 'src')
-rw-r--r-- | src/stepCounter/StepCounterPreview.qml | 5 | ||||
-rw-r--r-- | src/stepCounter/StepsDetailPage.qml | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/stepCounter/StepCounterPreview.qml b/src/stepCounter/StepCounterPreview.qml index 3c2d3f0..8ef611e 100644 --- a/src/stepCounter/StepCounterPreview.qml +++ b/src/stepCounter/StepCounterPreview.qml @@ -79,6 +79,11 @@ MouseArea { dataLoadingDone() } indicatorLineHeight: loggerSettings.stepGoalEnabled ? loggerSettings.stepGoalTarget : 0 + onBarClicked: (index)=> { + var d = new Date() + d.setDate(d.getDate() - 6 + index) + pageStack.push(detailPage,{"currentDay": d}) + } } } onClicked: pageStack.push(detailPage) diff --git a/src/stepCounter/StepsDetailPage.qml b/src/stepCounter/StepsDetailPage.qml index 9d141dd..978a411 100644 --- a/src/stepCounter/StepsDetailPage.qml +++ b/src/stepCounter/StepsDetailPage.qml @@ -24,6 +24,8 @@ import org.asteroid.sensorlogd 1.0 import "../graphs" Item { + id: root + property date currentDay: new Date() Flickable { anchors.fill: parent contentHeight: contentColumn.implicitHeight @@ -33,13 +35,21 @@ Item { Item { width: parent.width; height: parent.width*0.2} + Label { + anchors { + left: parent.left + margins: app.width*0.1 + } + text: graph.startTime.toLocaleDateString() + } + StepsLineGraph { id: graph anchors.horizontalCenter: parent.horizontalCenter width: parent.width*0.9 height: app.height*2/3 - startTime: new Date() - endTime: new Date() + startTime: root.currentDay + endTime: root.currentDay } Row { anchors.horizontalCenter: parent.horizontalCenter |