make bg clock draggable

This commit is contained in:
end-4
2025-11-05 00:07:38 +01:00
parent 67695c8edb
commit 0e7422c335
23 changed files with 521 additions and 353 deletions
@@ -0,0 +1,26 @@
import QtQuick
import Quickshell
import qs.modules.common
/*
* Widget to be placed on a WidgetCanvas
*/
MouseArea {
id: root
property bool draggable: true
drag.target: draggable ? root : undefined
cursorShape: drag.active ? Qt.ClosedHandCursor : draggable ? Qt.OpenHandCursor : Qt.ArrowCursor
function center() {
root.x = (root.parent.width - root.width) / 2
root.y = (root.parent.height - root.height) / 2
}
Behavior on x {
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
}
Behavior on y {
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
}
}