tweener



Hi,
In previous mails I have spoken of a extension that I've developed to monitor a background process. To avoid the problem that gnome-shell disables the extensions when screen is idle, I have emptied the methods enable() and disable(). Now it works well except the Tweener class when the screen is idle. This object (Tweener) is destroyed and it isn't resumed when the session is restored. This is the code fragment:

const IconAnimated = new Lang.Class({
    Name: 'IconAnimated',
    Extends: St.Icon,
   
    _init: function(icon_name, style_class) {
       
        this.parent({ icon_name: icon_name, style_class: style_class });

        this.TweenIn = {
            opacity:20,
            time:1,
            transition:'easeInOutSine',
            onComplete: function() {
                Tweener.addTween(this, this.TweenOut);
            }
        }

        this.TweenOut = {
            opacity:255,
            time:1,
            transition:'easeInOutSine',
            onComplete: function() {
                if (this.isDownloading) {
                    Tweener.addTween(this, this.TweenIn);
                } else {
                    return false;                   
                }
                return true;
            }
        }

    },

    startAnimation: function() {
        this.isDownloading = true;
        this.set_icon_name(ICON_ACTIVO);
        Tweener.addTween(this, this.TweenOut);
    },

    stopAnimation: function() {
        this.isDownloading = false;
        Tweener.removeTweens(this);
        this.opacity = 255;
        this.set_icon_name(ICON_INACTIVO);
    }
});

Do you know some way to skip this bug? Another way to animate the panel icon?
Regards.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]