diff options
author | dodoradio <dodoradio@outlook.com> | 2023-08-20 20:41:56 +0100 |
---|---|---|
committer | dodoradio <dodoradio@outlook.com> | 2023-08-21 22:19:08 +0100 |
commit | 5dd341b6aef969cac3f601d32e91b2f39809cd8a (patch) | |
tree | 8d616d23ffb205eba9eb29584749c394c254b25d /src/stepCounter | |
parent | 6ae32dffa9939ee2a8ba1241659a9540dd88496b (diff) |
It doesn't make sense for this text to show when we're looking at periods longer than a day, so we make it disappear for those cases.
Diffstat (limited to 'src/stepCounter')
-rw-r--r-- | src/stepCounter/StepsDetailPage.qml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stepCounter/StepsDetailPage.qml b/src/stepCounter/StepsDetailPage.qml index 2862eea..ac41749 100644 --- a/src/stepCounter/StepsDetailPage.qml +++ b/src/stepCounter/StepsDetailPage.qml @@ -38,12 +38,13 @@ Item { Label { width: parent.width*0.8 anchors.horizontalCenter: parent.horizontalCenter - text: stepsDataLoader.getTodayTotal() ? "You've walked " + stepsDataLoader.todayTotal + " steps today, keep it up!" : "You haven't yet logged any steps today" + text: dateCompare(stepsLineGraph.startTime,new Date()) ? (stepsDataLoader.getTodayTotal() ?"You've walked " + stepsDataLoader.todayTotal + " steps today, keep it up!" : "You haven't yet logged any steps today") : ("You walked " + stepsDataLoader.getTotalForDate(stepsLineGraph.startTime) + " steps on this day") // 'on this day' is really clunky. TODO: revise wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter + visible: dateCompare(stepsLineGraph.startTime,stepsLineGraph.endTime) } - Item { width: parent.width; height: parent.width*0.1} + Item { width: parent.width; height: parent.width*0.1; visible: dateCompare(stepsLineGraph.startTime,stepsLineGraph.endTime)} Label { anchors { left: parent.left |