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 implicitWidth: screen.width
implicitHeight: screen.height 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 { ListModel {
id: petModels id: petModels
ListElement { ListElement {
width: 320; width: 320;
height: 293; height: 293;
x: 200; x: 0;
y: 200; y: 1124;
source: "./Gifs/evernight.gif" source: "./Gifs/evernight.gif"
} }
} }
@@ -39,6 +51,12 @@ PanelWindow {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
drag.target: parent drag.target: parent
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
onClicked: (mouse) => {
if (mouse.button === Qt.MiddleButton) {
mainWindow.toggleLayer()
}
}
} }
} }
} }