Fix extension for GNOME 3.32

References #2
This commit is contained in:
Martin Zurowietz 2019-03-17 11:31:00 +01:00
parent 1fe0213dea
commit d2218d5f3b
2 changed files with 7 additions and 10 deletions

View file

@ -1,6 +1,6 @@
{ {
"shell-version": ["3.28", "3.30"], "shell-version": ["3.28", "3.30", "3.32"],
"uuid": "batime@martin.zurowietz.de", "uuid": "batime@martin.zurowietz.de",
"url": "https://github.com/mzur/gnome-shell-batime", "url": "https://github.com/mzur/gnome-shell-batime",
"settings-schema": "org.gnome.shell.extensions.batime", "settings-schema": "org.gnome.shell.extensions.batime",

View file

@ -1,11 +1,8 @@
const Lang = imports.lang; const Lang = imports.lang;
const UPower = imports.gi.UPowerGlib; const UPower = imports.gi.UPowerGlib;
const BaseIndicator = imports.ui.status.power.Indicator;
var Indicator = new Lang.Class({ var Indicator = class extends BaseIndicator {
Name: 'PowerIndicator',
Extends: imports.ui.status.power.Indicator,
// Adapted from _getStatus of the parent. // Adapted from _getStatus of the parent.
_getTime() { _getTime() {
let seconds = 0; let seconds = 0;
@ -33,10 +30,10 @@ var Indicator = new Lang.Class({
// Translators: this is <hours>:<minutes> // Translators: this is <hours>:<minutes>
return _("%d\u2236%02d").format(hours, minutes); return _("%d\u2236%02d").format(hours, minutes);
}, }
_sync() { _sync() {
this.parent(); super._sync();
this._percentageLabel.clutter_text.set_markup('<span size="smaller">' + this._getTime() + '</span>'); this._percentageLabel.clutter_text.set_markup('<span size="smaller">' + this._getTime() + '</span>');
}, }
}); }