diff options
Diffstat (limited to 'mobile-widgets/qml/StatisticsPage.qml')
| -rw-r--r-- | mobile-widgets/qml/StatisticsPage.qml | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/mobile-widgets/qml/StatisticsPage.qml b/mobile-widgets/qml/StatisticsPage.qml index 72a50602f..0a9a7bdea 100644 --- a/mobile-widgets/qml/StatisticsPage.qml +++ b/mobile-widgets/qml/StatisticsPage.qml @@ -15,6 +15,7 @@ Kirigami.Page { bottomPadding: 0 width: rootItem.width implicitWidth: rootItem.width + background: Rectangle { color: subsurfaceTheme.backgroundColor } property bool wide: width > rootItem.height StatsManager { id: statsManager @@ -31,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 @@ -56,6 +69,7 @@ Kirigami.Page { Label { text: chartName font.bold: isHeader + color: subsurfaceTheme.textColor } } } @@ -87,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") } @@ -193,10 +208,10 @@ Kirigami.Page { onClicked: chartTypePopup.open() } Item { - Layout.column: wide ? 0 : 1 + Layout.column: wide ? 0 : 2 Layout.row: wide ? 6 : 2 Layout.preferredHeight: wide ? parent.height - Kirigami.Units.gridUnit * 16 : Kirigami.Units.gridUnit - Layout.preferredWidth: wide ? parent.width - i1.implicitWidt - i2.implicitWidt - i3.implicitWidt - i4.implicitWidth : Kirigami.Units.gridUnit + Layout.fillWidth: wide ? false : true // just used for spacing } StatsView { |