diff --git a/Gifs/kkpt7gm8035d1.gif b/Gifs/Acheron.gif similarity index 100% rename from Gifs/kkpt7gm8035d1.gif rename to Gifs/Acheron.gif diff --git a/Gifs/24pobgj850vf1.gif b/Gifs/Evernight.gif similarity index 100% rename from Gifs/24pobgj850vf1.gif rename to Gifs/Evernight.gif diff --git a/Gifs/evernight.gif b/Gifs/evernight.gif deleted file mode 100644 index 01d0f08..0000000 Binary files a/Gifs/evernight.gif and /dev/null differ diff --git a/Modules/Mouse.qml b/Modules/Mouse.qml index 37e3191..4caa4dc 100644 --- a/Modules/Mouse.qml +++ b/Modules/Mouse.qml @@ -3,27 +3,10 @@ import QtQuick MouseArea { anchors.fill: parent acceptedButtons: Qt.LeftButton - property bool dragging: false - property real offsetX: 0 - property real offsetY: 0 - - onPressed: { - if (mouse.x >= original.x && - mouse.x <= original.x + original.width && - mouse.y >= original.y && - mouse.y <= original.y + original.height) { - dragging = true - offsetX = mouse.x - original.x - offsetY = mouse.y - original.y - } - } - - onReleased: dragging = false - - onPositionChanged: { - if (dragging) { - original.x = Math.max(0, Math.min(mouse.x - offsetX, Screen.width - original.width)) - original.y = Math.max(0, Math.min(mouse.y - offsetY, Screen.height - original.height)) - } - } + drag.target: dragEvernight + drag.axis: Drag.XAndYAxis + drag.minimumX: 0 + drag.maximumX: Screen.width - evernight.width + drag.minimumY: 0 + drag.maximumY: Screen.height - evernight.height } diff --git a/Modules/PetAcheron.qml b/Modules/PetAcheron.qml new file mode 100644 index 0000000..ee3287d --- /dev/null +++ b/Modules/PetAcheron.qml @@ -0,0 +1,13 @@ +import QtQuick +import Quickshell.Io +import Quickshell.Wayland + +Rectangle { + width: 227 + height: 212 + + AnimatedImage { + source: "../Gifs/Acheron.gif" + fillMode: Image.PreserveAspectFit + } +} diff --git a/Modules/PetMarch.qml b/Modules/PetMarch.qml index 2e474db..93bd241 100644 --- a/Modules/PetMarch.qml +++ b/Modules/PetMarch.qml @@ -6,10 +6,8 @@ Rectangle { width: 320 height: 293 - // anchors.bottom: parent.bottom - AnimatedImage { - source: "../Gifs/evernight.gif" + source: "../Gifs/Evernight.gif" fillMode: Image.PreserveAspectFit } diff --git a/shell.qml b/shell.qml index 65177aa..b5a4088 100644 --- a/shell.qml +++ b/shell.qml @@ -1,14 +1,15 @@ pragma ComponentBehavior: Bound import QtQuick import Quickshell +import Quickshell.Io import Quickshell.Wayland import qs.Modules -// import qs.Functions PanelWindow { id: mainWindow color: "transparent" property bool onTop: true + property bool setMask: true WlrLayershell.layer: WlrLayer.Top anchors { left: true @@ -23,30 +24,59 @@ PanelWindow { } mask: Region { - intersection: intersection.Intersect + item: evernight,acheron + } + + property var yesMask: Region { + item: dragEvernight + } + + property var noMask: Region { + } + + IpcHandler { + target: "Mask" + + function edmask(): void { + if ( !mainWindow.setMask ) { + mainWindow.mask = yesMask + mainWindow.setMask = true + } else { + mainWindow.mask = noMask + mainWindow.setMask = false + } + } } surfaceFormat.opaque: false implicitWidth: Screen.width implicitHeight: Screen.height - PetMarch { - id: petMarch2 - color: mainWindow.color - anchors.right: parent.right - anchors.bottom: parent.bottom - } - - // Mve this pet - PetMarch { - id: original - color: mainWindow.color + Item { + id: dragEvernight x: 0 y: 1147 - // anchors.leftMargin: parent.leftMargin - // anchors.bottomMargin: parent.bottomMargin + width: evernight.width + height: evernight.height + PetMarch { + id: evernight + color: mainWindow.color + } + + Mouse {} } - Mouse { + Item { + id: dragAcheron + x: 2300 + y: 1230 + width: acheron.width + height: acheron.height + PetAcheron { + id: acheron + color: mainWindow.color + } + + Mouse {} } }