This commit is contained in:
2025-10-23 00:47:29 +02:00
parent bdccb9e0aa
commit 03adbbd38f
4 changed files with 58 additions and 26 deletions
-16
View File
@@ -1,16 +0,0 @@
import QtQuick
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
drag.target: null // Not using built-in drag behavior
onPositionChanged: {
if (mouse.buttons & Qt.LeftButton) {
petMarch.mleft = mouse.x
petMarch.mbottom = mouse.y
console.log("mleft:", petMarch.mleft, "mbottom:", petMarch.mbottom)
}
}
}
+29
View File
@@ -0,0 +1,29 @@
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))
}
}
}
+5 -4
View File
@@ -3,15 +3,16 @@ import Quickshell.Io
import Quickshell.Wayland
Rectangle {
width: 320
height: 293
// anchors.bottom: parent.bottom
AnimatedImage {
source: "../Gifs/evernight.gif"
fillMode: Image.PreserveAspectFit
}
// margins {
// mainWindow.left: 50
// }
IpcHandler {
target: "command"
+24 -6
View File
@@ -3,7 +3,7 @@ import QtQuick
import Quickshell
import Quickshell.Wayland
import qs.Modules
import qs.Functions
// import qs.Functions
PanelWindow {
id: mainWindow
@@ -17,18 +17,36 @@ PanelWindow {
margins {
left: 0
right: 0
top: 0
bottom: 9
}
mask: Region {}
mask: Region {
intersection: intersection.Intersect
}
surfaceFormat.opaque: false
implicitWidth: 320
implicitHeight: 293
implicitWidth: Screen.width
implicitHeight: Screen.height
PetMarch {
id: petMarch
id: petMarch2
color: mainWindow.color
anchors.fill: parent
anchors.right: parent.right
anchors.bottom: parent.bottom
}
// Mve this pet
PetMarch {
id: original
color: mainWindow.color
x: 0
y: 1147
// anchors.leftMargin: parent.leftMargin
// anchors.bottomMargin: parent.bottomMargin
}
Mouse {
}
}