appDisplay: Add API to animate launch at given position
Add a `animateLaunchAtPos()` method to the AppIcon class to animate the launch of an app at a given position. This allows for a visual indication of whether dropping an app icon using DnD was successful at the position the drop happened in a later commit. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/121
This commit is contained in:
parent
259874d731
commit
daa5452af2
@ -2208,6 +2208,10 @@ var AppIcon = class AppIcon {
|
|||||||
this.icon.animateZoomOut();
|
this.icon.animateZoomOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
animateLaunchAtPos(x, y) {
|
||||||
|
this.icon.animateZoomOutAtPos(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
scaleIn() {
|
scaleIn() {
|
||||||
this.actor.scale_x = 0;
|
this.actor.scale_x = 0;
|
||||||
this.actor.scale_y = 0;
|
this.actor.scale_y = 0;
|
||||||
|
@ -142,6 +142,10 @@ class BaseIcon extends St.Bin {
|
|||||||
zoomOutActor(this.child);
|
zoomOutActor(this.child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
animateZoomOutAtPos(x, y) {
|
||||||
|
zoomOutActorAtPos(this.child, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
this._createIconTexture(this.iconSize);
|
this._createIconTexture(this.iconSize);
|
||||||
}
|
}
|
||||||
@ -152,10 +156,15 @@ function clamp(value, min, max) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function zoomOutActor(actor) {
|
function zoomOutActor(actor) {
|
||||||
|
let [x, y] = actor.get_transformed_position();
|
||||||
|
zoomOutActorAtPos(actor, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
function zoomOutActorAtPos(actor, x, y) {
|
||||||
let actorClone = new Clutter.Clone({ source: actor,
|
let actorClone = new Clutter.Clone({ source: actor,
|
||||||
reactive: false });
|
reactive: false });
|
||||||
let [width, height] = actor.get_transformed_size();
|
let [width, height] = actor.get_transformed_size();
|
||||||
let [x, y] = actor.get_transformed_position();
|
|
||||||
actorClone.set_size(width, height);
|
actorClone.set_size(width, height);
|
||||||
actorClone.set_position(x, y);
|
actorClone.set_position(x, y);
|
||||||
actorClone.opacity = 255;
|
actorClone.opacity = 255;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user