Fix runtime issue and expose new indicator
This commit is contained in:
parent
af03075ef3
commit
11affed9bb
2 changed files with 4 additions and 2 deletions
|
|
@ -6,13 +6,14 @@ class BaTimeExtension {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.aggregateMenu = Panel.statusArea.quickSettings;
|
this.aggregateMenu = Panel.statusArea.quickSettings;
|
||||||
this.originalIndicator = this.aggregateMenu._system;
|
this.originalIndicator = this.aggregateMenu._system;
|
||||||
this.customIndicator = new BaTime.imports.power.Indicator();
|
this.aggregateMenu._system = this.customIndicator = new BaTime.imports.power.Indicator();
|
||||||
this.aggregateMenu._indicators.replace_child(
|
this.aggregateMenu._indicators.replace_child(
|
||||||
this.originalIndicator,
|
this.originalIndicator,
|
||||||
this.customIndicator
|
this.customIndicator
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
destroy() {
|
destroy() {
|
||||||
|
this.aggregateMenu._system = this.originalIndicator;
|
||||||
this.aggregateMenu._indicators.replace_child(
|
this.aggregateMenu._indicators.replace_child(
|
||||||
this.customIndicator,
|
this.customIndicator,
|
||||||
this.originalIndicator
|
this.originalIndicator
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ var Indicator = GObject.registerClass(
|
||||||
// Adapted from _getStatus of the parent.
|
// Adapted from _getStatus of the parent.
|
||||||
_getTime() {
|
_getTime() {
|
||||||
let seconds = 0;
|
let seconds = 0;
|
||||||
let state = this._systemItem.powerToggle._proxy.State;
|
let proxy = this._systemItem.powerToggle._proxy;
|
||||||
|
let state = proxy.State;
|
||||||
|
|
||||||
if (state === UPower.DeviceState.FULLY_CHARGED) {
|
if (state === UPower.DeviceState.FULLY_CHARGED) {
|
||||||
return '';
|
return '';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue