Skip to content

Commit

Permalink
desklet.js: Port to Clutter animations (#12073)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephMcc committed Apr 5, 2024
1 parent dc6f626 commit 7fa70d0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions js/ui/desklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const PopupMenu = imports.ui.popupMenu;
const Tooltips = imports.ui.tooltips;
const Tweener = imports.ui.tweener;
const Gettext = imports.gettext;


const RIGHT_PANEL_POPUP_ANIMATE_TIME = 0.5;
const DESKLET_DESTROY_TIME = 0.5;
const DESKLET_DESTROY_TIME = 500;

/**
* #Desklet
Expand Down Expand Up @@ -124,15 +123,17 @@ var Desklet = class Desklet {
*
* Destroys the actor with an fading animation
*/
destroy(deleteConfig){
Tweener.addTween(this.actor,
{ opacity: 0,
transition: 'linear',
time: DESKLET_DESTROY_TIME,
onComplete: Lang.bind(this, function(){
this.on_desklet_removed(deleteConfig);
this.actor.destroy();
})});
destroy(deleteConfig) {
this.actor.ease({
opacity: 0,
duration: DESKLET_DESTROY_TIME,
mode: Clutter.AnimationMode.LINEAR,
onComplete: () => {
this.on_desklet_removed(deleteConfig);
this.actor.destroy();
}
});

this._menu.destroy();

this._menu = null;
Expand Down

0 comments on commit 7fa70d0

Please sign in to comment.