mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
spotlight: optimize to keep loaded
This commit is contained in:
@@ -14,8 +14,31 @@ Singleton {
|
||||
property var activeModal: null
|
||||
property bool windowsVisible: false
|
||||
property var targetScreen: null
|
||||
property var persistentModal: null
|
||||
|
||||
readonly property bool hasActiveModal: activeModal !== null
|
||||
readonly property bool hasPersistentModal: persistentModal !== null
|
||||
readonly property bool isPersistentModalActive: hasActiveModal && activeModal === persistentModal
|
||||
readonly property bool shouldShowModal: hasActiveModal
|
||||
readonly property bool shouldKeepWindowsAlive: hasPersistentModal
|
||||
|
||||
onPersistentModalChanged: {
|
||||
if (!persistentModal)
|
||||
return;
|
||||
cachedModal = persistentModal;
|
||||
cachedModalWidth = Theme.px(persistentModal.modalWidth, dpr);
|
||||
cachedModalHeight = Theme.px(persistentModal.modalHeight, dpr);
|
||||
cachedModalX = calculateX(persistentModal);
|
||||
cachedModalY = calculateY(persistentModal);
|
||||
cachedAnimationDuration = persistentModal.animationDuration ?? Theme.shortDuration;
|
||||
cachedEnterCurve = persistentModal.animationEnterCurve ?? Theme.expressiveCurves.expressiveFastSpatial;
|
||||
cachedExitCurve = persistentModal.animationExitCurve ?? Theme.expressiveCurves.expressiveFastSpatial;
|
||||
cachedScaleCollapsed = persistentModal.animationScaleCollapsed ?? 0.96;
|
||||
if (persistentModal.directContent) {
|
||||
persistentModal.directContent.parent = directContentWrapper;
|
||||
persistentModal.directContent.anchors.fill = directContentWrapper;
|
||||
}
|
||||
}
|
||||
readonly property var screen: backgroundWindow.screen
|
||||
readonly property real dpr: screen ? CompositorService.getScreenScale(screen) : 1
|
||||
readonly property real shadowBuffer: 5
|
||||
@@ -161,7 +184,7 @@ Singleton {
|
||||
|
||||
PanelWindow {
|
||||
id: backgroundWindow
|
||||
visible: root.windowsVisible
|
||||
visible: root.windowsVisible || root.shouldKeepWindowsAlive
|
||||
screen: root.targetScreen
|
||||
color: "transparent"
|
||||
|
||||
@@ -223,7 +246,7 @@ Singleton {
|
||||
|
||||
PanelWindow {
|
||||
id: contentWindow
|
||||
visible: root.windowsVisible
|
||||
visible: root.windowsVisible || root.shouldKeepWindowsAlive
|
||||
screen: root.targetScreen
|
||||
color: "transparent"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user