last 7 months of qs changes
This commit is contained in:
parent
2c64563ade
commit
4b90113a54
103 changed files with 3467 additions and 1415 deletions
47
modules/user/modules/quickshell/shell/SlideViewItem.qml
Normal file
47
modules/user/modules/quickshell/shell/SlideViewItem.qml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue