Add loader to ScreenCorner, proper position for SidePanel, update Settings & NPanel to only display one NPanel at a time (latest one)

This commit is contained in:
Ly-sec 2025-08-10 17:25:49 +02:00
parent cdee8023de
commit 7b653ec5a3
8 changed files with 208 additions and 138 deletions

View file

@ -27,6 +27,7 @@ Loader {
Connections {
target: loader.item
ignoreUnknownSignals: true
function onDismissed() {
loader.isLoaded = false
}

View file

@ -13,11 +13,20 @@ PanelWindow {
signal dismissed
function hide() {
visible = false
//visible = false
dismissed()
}
function show() {
// Ensure only one panel is visible at a time using Settings as ephemeral store
try {
if (Settings.openPanel && Settings.openPanel !== outerPanel && Settings.openPanel.hide) {
Settings.openPanel.hide()
}
Settings.openPanel = outerPanel
} catch (e) {
// ignore
}
visible = true
}
@ -44,4 +53,16 @@ PanelWindow {
easing.type: Easing.InOutCubic
}
}
Component.onDestruction: {
try {
if (visible && Settings.openPanel === outerPanel) Settings.openPanel = null
} catch (e) {}
}
onVisibleChanged: function() {
try {
if (!visible && Settings.openPanel === outerPanel) Settings.openPanel = null
} catch (e) {}
}
}