aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-18 07:52:03 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-19 12:42:48 -0800
commit35f1b9e2044ec1891331102881cd354199a64baa (patch)
tree7e92cba3c347f1288c2e46546ec779968af638a5 /mobile-widgets
parent5f6d223184d2b79f9125b2969d4163d72089377d (diff)
downloadsubsurface-35f1b9e2044ec1891331102881cd354199a64baa.tar.gz
mobile/statistics: force redraw after rotation
Sometimes (and it's unclear why that happens) after rotation the stats widget is blank. Setting the first variable back to itself appears enough to ensure that the statistics view is redrawn. Try to do that programatically after a short delay. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/StatisticsPage.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/mobile-widgets/qml/StatisticsPage.qml b/mobile-widgets/qml/StatisticsPage.qml
index 97d504222..0a9a7bdea 100644
--- a/mobile-widgets/qml/StatisticsPage.qml
+++ b/mobile-widgets/qml/StatisticsPage.qml
@@ -32,6 +32,18 @@ Kirigami.Page {
statsManager.doit()
}
}
+ onWideChanged: {
+ // so this means we rotated the device - and sometimes after rotation
+ // the stats widget is empty.
+ rotationRedrawTrigger.start()
+ }
+ Timer {
+ // wait .5 seconds (so the OS rotation animation has a chance to run) and then set var1 again
+ // to its current value, which appears to be enough to ensure that the chart is drawn again
+ id: rotationRedrawTrigger
+ interval: 500
+ onTriggered: statsManager.var1Changed(i1.var1currentIndex)
+ }
Component {
id: chartListDelegate
@@ -89,6 +101,7 @@ Kirigami.Page {
Layout.row: 0
Layout.leftMargin: Kirigami.Units.smallSpacing
Layout.topMargin: Kirigami.Units.smallSpacing
+ property alias var1currentIndex: var1.currentIndex
TemplateLabelSmall {
text: qsTr("Base variable")
}