expansion
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell.Wayland
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
property bool onTop: true
|
||||||
|
|
||||||
|
// The main toggle function
|
||||||
|
function toggleLayer() {
|
||||||
|
if (!onTop) {
|
||||||
|
mainWindow.WlrLayershell.layer = WlrLayer.Top
|
||||||
|
onTop = true
|
||||||
|
} else {
|
||||||
|
mainWindow.WlrLayershell.layer = WlrLayer.Bottom
|
||||||
|
onTop = false
|
||||||
|
}
|
||||||
|
console.log("Toggled layer, onTop =")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
AnimatedImage {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: "../Gifs/evernight.gif"
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.MiddleButton
|
||||||
|
onClicked: (mouse) => {
|
||||||
|
if (mouse.button === Qt.MiddleButton) {
|
||||||
|
toggleHelper.toggleLayer()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
//import qs.Gifs
|
import qs.Modules
|
||||||
|
import qs.Functions
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: mainWindow
|
id: mainWindow
|
||||||
@@ -20,37 +22,17 @@ PanelWindow {
|
|||||||
bottom: 5
|
bottom: 5
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool onTop: true
|
IpcHandler {
|
||||||
|
id: ipc
|
||||||
function toggleLayer() {
|
target: mainWindow
|
||||||
if (onTop) {
|
function getColor() { return mainWindow.color.toString() }
|
||||||
WlrLayershell.layer = WlrLayer.Bottom
|
|
||||||
onTop = false
|
|
||||||
} else {
|
|
||||||
WlrLayershell.layer = WlrLayer.Top
|
|
||||||
onTop = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
ToggleLayer {
|
||||||
anchors.fill: parent
|
id: toggleHelper
|
||||||
color: "transparent"
|
}
|
||||||
|
|
||||||
id: petContainer
|
PetMarch{
|
||||||
AnimatedImage {
|
id:petMarch
|
||||||
anchors.fill: parent
|
|
||||||
source: "Gifs/evernight.gif"
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.MiddleButton
|
|
||||||
onClicked: (mouse) => {
|
|
||||||
if (mouse.button === Qt.MiddleButton) {
|
|
||||||
mainWindow.toggleLayer()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user