REGIONS
This commit is contained in:
|
Before Width: | Height: | Size: 647 KiB After Width: | Height: | Size: 647 KiB |
|
Before Width: | Height: | Size: 298 KiB After Width: | Height: | Size: 298 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 298 KiB |
+6
-23
@@ -3,27 +3,10 @@ import QtQuick
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
property bool dragging: false
|
drag.target: dragEvernight
|
||||||
property real offsetX: 0
|
drag.axis: Drag.XAndYAxis
|
||||||
property real offsetY: 0
|
drag.minimumX: 0
|
||||||
|
drag.maximumX: Screen.width - evernight.width
|
||||||
onPressed: {
|
drag.minimumY: 0
|
||||||
if (mouse.x >= original.x &&
|
drag.maximumY: Screen.height - evernight.height
|
||||||
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))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,10 +6,8 @@ Rectangle {
|
|||||||
width: 320
|
width: 320
|
||||||
height: 293
|
height: 293
|
||||||
|
|
||||||
// anchors.bottom: parent.bottom
|
|
||||||
|
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
source: "../Gifs/evernight.gif"
|
source: "../Gifs/Evernight.gif"
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
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.Modules
|
import qs.Modules
|
||||||
// import qs.Functions
|
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: mainWindow
|
id: mainWindow
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
property bool onTop: true
|
property bool onTop: true
|
||||||
|
property bool setMask: true
|
||||||
WlrLayershell.layer: WlrLayer.Top
|
WlrLayershell.layer: WlrLayer.Top
|
||||||
anchors {
|
anchors {
|
||||||
left: true
|
left: true
|
||||||
@@ -23,30 +24,59 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mask: Region {
|
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
|
surfaceFormat.opaque: false
|
||||||
implicitWidth: Screen.width
|
implicitWidth: Screen.width
|
||||||
implicitHeight: Screen.height
|
implicitHeight: Screen.height
|
||||||
|
|
||||||
PetMarch {
|
Item {
|
||||||
id: petMarch2
|
id: dragEvernight
|
||||||
color: mainWindow.color
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mve this pet
|
|
||||||
PetMarch {
|
|
||||||
id: original
|
|
||||||
color: mainWindow.color
|
|
||||||
x: 0
|
x: 0
|
||||||
y: 1147
|
y: 1147
|
||||||
// anchors.leftMargin: parent.leftMargin
|
width: evernight.width
|
||||||
// anchors.bottomMargin: parent.bottomMargin
|
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 {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user