Compatibility with GNOME 3.36

Resolves #4
This commit is contained in:
Martin Zurowietz 2020-03-10 16:50:26 +01:00
parent 062304ba21
commit e842589bb2
3 changed files with 9 additions and 7 deletions

View file

@ -8,14 +8,14 @@ class BaTimeExtension {
this.originalIndicator = this.aggregateMenu._power;
this.customIndicator = new BaTime.imports.power.Indicator();
this.aggregateMenu._indicators.replace_child(
this.originalIndicator.indicators,
this.customIndicator.indicators
this.originalIndicator,
this.customIndicator
);
}
destroy() {
this.aggregateMenu._indicators.replace_child(
this.customIndicator.indicators,
this.originalIndicator.indicators
this.customIndicator,
this.originalIndicator
);
}
}

View file

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

View file

@ -1,8 +1,10 @@
const { GObject} = imports.gi;
const Lang = imports.lang;
const UPower = imports.gi.UPowerGlib;
const BaseIndicator = imports.ui.status.power.Indicator;
var Indicator = class extends BaseIndicator {
var Indicator = GObject.registerClass(
class Indicator extends BaseIndicator {
// Adapted from _getStatus of the parent.
_getTime() {
let seconds = 0;
@ -36,4 +38,4 @@ var Indicator = class extends BaseIndicator {
super._sync();
this._percentageLabel.clutter_text.set_markup('<span size="smaller">' + this._getTime() + '</span>');
}
}
});