Skip to content

Commit

Permalink
systemTemerature@KopfDesDaemons: new screenshot, refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
KopfdesDaemons committed Nov 24, 2024
1 parent 8c100e3 commit bd01bdc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ function _(str) {
return Gettext.dgettext(UUID, str);
}

function TemperatureDesklet(metadata, deskletId) {
function MyDesklet(metadata, deskletId) {
this._init(metadata, deskletId);
}

TemperatureDesklet.prototype = {
MyDesklet.prototype = {
__proto__: Desklet.Desklet.prototype,

_init: function (metadata, deskletId) {
Expand Down Expand Up @@ -140,24 +140,14 @@ TemperatureDesklet.prototype = {
},

on_desklet_removed: function () {
// Clean up the timeout when the desklet is removed
if (this._timeout) {
Mainloop.source_remove(this._timeout);
this._timeout = null;
}

if (this.label) {
this.box.remove_child(this.label);
this.label = null;
}
if (this._timeout) Mainloop.source_remove(this._timeout);
if (this.label) this.box.remove_child(this.label);
if (this.temperatureLabel) this.box.remove_child(this.temperatureLabel);

if (this.temperatureLabel) {
this.box.remove_child(this.temperatureLabel);
this.temperatureLabel = null;
}
this.label = this.temperatureLabel = this._timeout = null;
}
};

function main(metadata, deskletId) {
return new TemperatureDesklet(metadata, deskletId);
return new MyDesklet(metadata, deskletId);
}
Binary file modified systemTemperature@KopfDesDaemons/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bd01bdc

Please sign in to comment.