Skip to content

Commit

Permalink
Shell Tooltip: replace imports.ui.tweener with Clutter functions
Browse files Browse the repository at this point in the history
imports.ui.tweener has been deprecated in favour of Clutter's implicit
animations. Clutter.Actor.prototype.ease() is a drop in replacement so
just use that instead.

See: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1200

closes #905
  • Loading branch information
andyholmes committed Aug 4, 2020
1 parent 96bcf1e commit acf0aa3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/shell/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const Pango = imports.gi.Pango;
const St = imports.gi.St;

const Main = imports.ui.main;
const Tweener = imports.ui.tweener;


/**
Expand Down Expand Up @@ -196,18 +195,18 @@ var Tooltip = class Tooltip {

// Show tooltip
if (this._showing) {
Tweener.addTween(this.bin, {
this.bin.ease({
x: x,
y: y,
time: 0.15,
transition: 'easeOutQuad'
transition: Clutter.AnimationMode.EASE_OUT_QUAD
});
} else {
this.bin.set_position(x, y);
Tweener.addTween(this.bin, {
this.bin.ease({
opacity: 232,
time: 0.15,
transition: 'easeOutQuad'
transition: Clutter.AnimationMode.EASE_OUT_QUAD
});

this._showing = true;
Expand All @@ -229,19 +228,18 @@ var Tooltip = class Tooltip {

_hide() {
if (this.bin) {
Tweener.addTween(this.bin, {
this.bin.ease({
opacity: 0,
time: 0.10,
transition: 'easeOutQuad',
transition: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
Main.layoutManager.uiGroup.remove_actor(this.bin);

if (this.custom) {
if (this.custom)
this.bin.remove_child(this.custom);
}

this.bin.destroy();
delete this.bin;
this.bin = null;
}
});
}
Expand Down

0 comments on commit acf0aa3

Please sign in to comment.