summaryrefslogtreecommitdiff
path: root/modules/controlcenter
diff options
context:
space:
mode:
authorATMDA <atdma2600@gmail.com>2025-11-16 13:28:29 -0500
committerATMDA <atdma2600@gmail.com>2025-11-16 14:03:20 -0500
commit007e94ad33943189cbb8a0ce981b0f737cc89377 (patch)
tree3bbd336f3877e617786403da104b929f0409d86c /modules/controlcenter
parentcontrolcenter: lazyloading applicatoins in launcher pane (diff)
downloadcaelestia-shell-007e94ad33943189cbb8a0ce981b0f737cc89377.tar.gz
caelestia-shell-007e94ad33943189cbb8a0ce981b0f737cc89377.tar.bz2
caelestia-shell-007e94ad33943189cbb8a0ce981b0f737cc89377.zip
controlcenter: caching and no destoying of panes
Diffstat (limited to 'modules/controlcenter')
-rw-r--r--modules/controlcenter/Panes.qml19
1 files changed, 18 insertions, 1 deletions
diff --git a/modules/controlcenter/Panes.qml b/modules/controlcenter/Panes.qml
index 8c76deb..28124a0 100644
--- a/modules/controlcenter/Panes.qml
+++ b/modules/controlcenter/Panes.qml
@@ -124,6 +124,9 @@ ClippingRectangle {
implicitWidth: root.width
implicitHeight: root.height
+ // Track if this pane has ever been loaded to enable caching
+ property bool hasBeenLoaded: false
+
Loader {
id: loader
@@ -135,12 +138,26 @@ ClippingRectangle {
// Always activate current and adjacent panes immediately for smooth transitions
if (diff <= 1) {
+ pane.hasBeenLoaded = true;
+ return true;
+ }
+
+ // For distant panes that have been loaded before, keep them active to preserve cached data
+ // Only wait for animation if pane hasn't been loaded yet
+ if (pane.hasBeenLoaded) {
return true;
}
- // For distant panes, wait until animation completes to avoid heavy loading during transition
+ // For new distant panes, wait until animation completes to avoid heavy loading during transition
return layout.animationComplete;
}
+
+ onItemChanged: {
+ // Mark pane as loaded when item is created
+ if (item) {
+ pane.hasBeenLoaded = true;
+ }
+ }
}
}
}