mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:03:23 +00:00
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>
This commit is contained in:
parent
5f6d223184
commit
35f1b9e204
1 changed files with 13 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue