diff --git a/js/ui/barLevel.js b/js/ui/barLevel.js index 4d75cc5d8..78aa03048 100644 --- a/js/ui/barLevel.js +++ b/js/ui/barLevel.js @@ -34,7 +34,11 @@ var BarLevel = class { this.connect('value-changed', this._valueChanged.bind(this)); } - setValue(value) { + get value() { + return this._value; + } + + set value(value) { if (isNaN(value)) throw TypeError('The bar level value must be a number'); @@ -42,7 +46,13 @@ var BarLevel = class { this.actor.queue_repaint(); } - setMaximumValue(value) { + // eslint-disable-next-line camelcase + get maximum_value() { + return this._maxValue; + } + + // eslint-disable-next-line camelcase + set maximum_value(value) { if (isNaN(value)) throw TypeError('The bar level max value must be a number'); @@ -51,7 +61,13 @@ var BarLevel = class { this.actor.queue_repaint(); } - setOverdriveStart(value) { + // eslint-disable-next-line camelcase + get overdrive_start() { + return this._overdriveStart; + } + + // eslint-disable-next-line camelcase + set overdrive_start(value) { if (isNaN(value)) throw TypeError('The overdrive limit value must be a number'); if (value > this._maxValue) @@ -196,9 +212,5 @@ var BarLevel = class { _valueChanged() { this._customAccessible.notify("accessible-value"); } - - get value() { - return this._value; - } }; Signals.addSignalMethods(BarLevel.prototype); diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js index 514287cb7..2d92d7cbb 100644 --- a/js/ui/osdWindow.js +++ b/js/ui/osdWindow.js @@ -32,7 +32,7 @@ var LevelBar = class extends BarLevel.BarLevel { set level(value) { this._level = Math.max(0, Math.min(value, this._maxLevel)); - this.setValue(this._level / 100); + this.value = this._level / 100; } get maxLevel() { @@ -42,7 +42,7 @@ var LevelBar = class extends BarLevel.BarLevel { set maxLevel(value) { this._maxLevel = Math.max(100, value); - this.setMaximumValue(this._maxLevel / 100); + this.maximum_level = this._maxLevel / 100; } }; diff --git a/js/ui/status/brightness.js b/js/ui/status/brightness.js index 54081eef3..ff31ef8df 100644 --- a/js/ui/status/brightness.js +++ b/js/ui/status/brightness.js @@ -58,6 +58,6 @@ var Indicator = class extends PanelMenu.SystemIndicator { let visible = this._proxy.Brightness >= 0; this._item.visible = visible; if (visible) - this._slider.setValue(this._proxy.Brightness / 100.0); + this._slider.value = this._proxy.Brightness / 100.0; } }; diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 64eeccf19..03be7b96c 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -130,17 +130,16 @@ var StreamSlider = class { _updateVolume() { let muted = this._stream.is_muted; - this._slider.setValue(muted ? 0 : (this._stream.volume / this._control.get_vol_max_norm())); + this._slider.value = muted + ? 0 : (this._stream.volume / this._control.get_vol_max_norm()); this.emit('stream-updated'); } _amplifySettingsChanged() { this._allowAmplified = this._soundSettings.get_boolean(ALLOW_AMPLIFIED_VOLUME_KEY); - if (this._allowAmplified) - this._slider.setMaximumValue(this.getMaxLevel() / 100); - else - this._slider.setMaximumValue(1); + this._slider.maximum_level = this._allowAmplified + ? this.getMaxLevel() / 100 : 1; if (this._stream) this._updateVolume();