Dragarea + swap layer top>bottom
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user