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() {
|
||||
this.aggregateMenu = Panel.statusArea.quickSettings;
|
||||
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.originalIndicator,
|
||||
this.customIndicator
|
||||
);
|
||||
}
|
||||
destroy() {
|
||||
this.aggregateMenu._system = this.originalIndicator;
|
||||
this.aggregateMenu._indicators.replace_child(
|
||||
this.customIndicator,
|
||||
this.originalIndicator
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ var Indicator = GObject.registerClass(
|
|||
// Adapted from _getStatus of the parent.
|
||||
_getTime() {
|
||||
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) {
|
||||
return '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue