mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-07 07:49:28 -05:00
31 lines
844 B
QML
31 lines
844 B
QML
import QtQuick
|
|
import Quickshell
|
|
import qs.modules.common
|
|
|
|
/*
|
|
* Widget to be placed on a WidgetCanvas
|
|
*/
|
|
MouseArea {
|
|
id: root
|
|
|
|
property alias animateXPos: xBehavior.enabled
|
|
property alias animateYPos: yBehavior.enabled
|
|
property bool draggable: true
|
|
drag.target: draggable ? root : undefined
|
|
cursorShape: (draggable && containsPress) ? 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 {
|
|
id: xBehavior
|
|
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
|
}
|
|
Behavior on y {
|
|
id: yBehavior
|
|
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
|
}
|
|
}
|