diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-02 22:23:15 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-02 22:23:15 +1000 |
| commit | 1ec02cb54e3083e726a5e4b745aa46527fa5a496 (patch) | |
| tree | e7ba3638ebf78af816d393ab3b456ab1d8981481 /widgets/StateLayer.qml | |
| parent | controls: use basic style (diff) | |
| download | caelestia-shell-1ec02cb54e3083e726a5e4b745aa46527fa5a496.tar.gz caelestia-shell-1ec02cb54e3083e726a5e4b745aa46527fa5a496.tar.bz2 caelestia-shell-1ec02cb54e3083e726a5e4b745aa46527fa5a496.zip | |
launcher: list item interactivity
Diffstat (limited to '')
| -rw-r--r-- | widgets/StateLayer.qml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/widgets/StateLayer.qml b/widgets/StateLayer.qml new file mode 100644 index 0000000..e1a7b61 --- /dev/null +++ b/widgets/StateLayer.qml @@ -0,0 +1,45 @@ +import "root:/widgets" +import "root:/config" +import QtQuick + +Rectangle { + id: root + + function onClicked(event: MouseEvent): void { + } + + anchors.fill: parent + + color: Appearance.colours.m3onSurface + opacity: mouse.pressed ? 0.1 : mouse.hovered ? 0.08 : 0 + + MouseArea { + id: mouse + + property bool hovered + + anchors.fill: parent + hoverEnabled: true + + onEntered: hovered = true + onExited: hovered = false + + onClicked: event => root.onClicked(event) + } + + Behavior on opacity { + NumberAnimation { + duration: Appearance.anim.durations.smaller + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + + Behavior on color { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } +} |