ported some quickshell stuff from rivendell-hyprdots

This commit is contained in:
Tomas Rivera
2026-03-10 16:22:35 +01:00
parent 4b442dd121
commit b9e3f35abe
80 changed files with 4462 additions and 9 deletions
+49
View File
@@ -0,0 +1,49 @@
import Quickshell
import QtQuick
QtObject {
id: root
required property Item item
property Animation activeAnimation: null
signal animationCompleted(self: SlideViewItem)
property Connections __animConnection: Connections {
target: activeAnimation
function onStopped() {
root.activeAnimation.destroy();
root.animationCompleted(root);
}
}
function createAnimation(component: Component) {
this.stopIfRunning();
this.activeAnimation = component.createObject(this, {
target: this.item
});
this.activeAnimation.running = true;
}
function stopIfRunning() {
if (this.activeAnimation) {
this.activeAnimation.stop();
this.activeAnimation = null;
}
}
function finishIfRunning() {
if (this.activeAnimation) {
// animator types dont handle complete correctly.
this.activeAnimation.complete();
this.activeAnimation.stop();
this.item.x = 0;
this.item.y = 0;
this.activeAnimation = null;
}
}
function destroyAll() {
this.item.destroy();
this.destroy();
}
}