From 5dd341b6aef969cac3f601d32e91b2f39809cd8a Mon Sep 17 00:00:00 2001 From: dodoradio Date: Sun, 20 Aug 2023 20:41:56 +0100 Subject: StepsDetailPage: make top text represent selected day's step count 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. --- src/stepCounter/StepsDetailPage.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/stepCounter') 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 -- cgit v1.2.3-70-g09d2