summaryrefslogtreecommitdiff
path: root/modules/dashboard/Content.qml
diff options
context:
space:
mode:
Diffstat (limited to 'modules/dashboard/Content.qml')
-rw-r--r--modules/dashboard/Content.qml10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/dashboard/Content.qml b/modules/dashboard/Content.qml
index f5f0e46..79659c5 100644
--- a/modules/dashboard/Content.qml
+++ b/modules/dashboard/Content.qml
@@ -85,6 +85,7 @@ Item {
id: row
Pane {
+ index: 0
sourceComponent: Dash {
visibilities: root.visibilities
state: root.state
@@ -92,16 +93,19 @@ Item {
}
Pane {
+ index: 1
sourceComponent: Media {
visibilities: root.visibilities
}
}
Pane {
+ index: 2
sourceComponent: Performance {}
}
Pane {
+ index: 3
sourceComponent: Weather {}
}
}
@@ -127,9 +131,15 @@ Item {
}
component Pane: Loader {
+ id: pane
+
+ required property int index
+
Layout.alignment: Qt.AlignTop
Component.onCompleted: active = Qt.binding(() => {
+ // Always keep current tab loaded
+ if (pane.index === view.currentIndex) return true;
const vx = Math.floor(view.visibleArea.xPosition * view.contentWidth);
const vex = Math.floor(vx + view.visibleArea.widthRatio * view.contentWidth);
return (vx >= x && vx <= x + implicitWidth) || (vex >= x && vex <= x + implicitWidth);