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

@ -85,7 +85,18 @@ PanelWindow {
icon: "widgets"
anchors.verticalCenter: parent.verticalCenter
onClicked: function () {
sidePanel.isLoaded = !sidePanel.isLoaded
// Map this button's center to the screen and open the side panel below it
const localCenterX = width / 2
const localCenterY = height / 2
const globalPoint = mapToItem(null, localCenterX, localCenterY)
if (sidePanel.isLoaded) {
sidePanel.isLoaded = false
} else if (sidePanel.openAt) {
sidePanel.openAt(globalPoint.x, screen)
} else {
// Fallback: toggle if API unavailable
sidePanel.isLoaded = true
}
}
}
}