Dragarea + swap layer top>bottom

This commit is contained in:
2025-10-07 17:41:57 +02:00
parent 7b299cf8f3
commit ccd3456416
+20 -2
View File
@@ -11,13 +11,25 @@ PanelWindow {
implicitWidth: screen.width
implicitHeight: screen.height
property bool onTop: true
function toggleLayer() {
if (onTop) {
WlrLayershell.layer = WlrLayer.Bottom
onTop = false
} else {
WlrLayershell.layer = WlrLayer.Top
onTop = true
}
}
ListModel {
id: petModels
ListElement {
width: 320;
height: 293;
x: 200;
y: 200;
x: 0;
y: 1124;
source: "./Gifs/evernight.gif"
}
}
@@ -39,6 +51,12 @@ PanelWindow {
MouseArea {
anchors.fill: parent
drag.target: parent
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
onClicked: (mouse) => {
if (mouse.button === Qt.MiddleButton) {
mainWindow.toggleLayer()
}
}
}
}
}