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