summaryrefslogtreecommitdiff
path: root/modules/dashboard/Content.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-28 22:08:17 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-28 22:08:17 +1000
commit45ebf3c70ef32167fba6439d249d18820a49b569 (patch)
tree9743c9f185d648d5805b71fe0267d1a4ea4bcb6d /modules/dashboard/Content.qml
parentinternal: use layouts for dashboard (diff)
downloadcaelestia-shell-45ebf3c70ef32167fba6439d249d18820a49b569.tar.gz
caelestia-shell-45ebf3c70ef32167fba6439d249d18820a49b569.tar.bz2
caelestia-shell-45ebf3c70ef32167fba6439d249d18820a49b569.zip
dashboard: loader panes
Diffstat (limited to 'modules/dashboard/Content.qml')
-rw-r--r--modules/dashboard/Content.qml32
1 files changed, 22 insertions, 10 deletions
diff --git a/modules/dashboard/Content.qml b/modules/dashboard/Content.qml
index 33171e0..4f4e242 100644
--- a/modules/dashboard/Content.qml
+++ b/modules/dashboard/Content.qml
@@ -1,3 +1,5 @@
+pragma ComponentBehavior: Bound
+
import "root:/widgets"
import "root:/services"
import "root:/config"
@@ -82,20 +84,20 @@ Item {
RowLayout {
id: row
- Dash {
- Layout.alignment: Qt.AlignTop
- shouldUpdate: visible && this === view.currentItem
- visibilities: root.visibilities
+ Pane {
+ sourceComponent: Dash {
+ visibilities: root.visibilities
+ }
}
- Media {
- Layout.alignment: Qt.AlignTop
- shouldUpdate: visible && this === view.currentItem
- visibilities: root.visibilities
+ Pane {
+ sourceComponent: Media {
+ visibilities: root.visibilities
+ }
}
- Performance {
- Layout.alignment: Qt.AlignTop
+ Pane {
+ sourceComponent: Performance {}
}
}
@@ -124,4 +126,14 @@ Item {
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
+
+ component Pane: Loader {
+ Layout.alignment: Qt.AlignTop
+
+ Component.onCompleted: active = Qt.binding(() => {
+ 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);
+ })
+ }
}