osdWindow: Use float values as input for osdWindow
Using the same type/interval as BarLevel means we can cut out the intermediate LevelBar class in a follow-up cleanup. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385
This commit is contained in:
@ -139,7 +139,7 @@ var StreamSlider = class {
|
||||
this._allowAmplified = this._soundSettings.get_boolean(ALLOW_AMPLIFIED_VOLUME_KEY);
|
||||
|
||||
this._slider.maximum_level = this._allowAmplified
|
||||
? this.getMaxLevel() / 100 : 1;
|
||||
? this.getMaxLevel() : 1;
|
||||
|
||||
if (this._stream)
|
||||
this._updateVolume();
|
||||
@ -173,7 +173,7 @@ var StreamSlider = class {
|
||||
if (!this._stream)
|
||||
return null;
|
||||
|
||||
return 100 * this._stream.volume / this._control.get_vol_max_norm();
|
||||
return this._stream.volume / this._control.get_vol_max_norm();
|
||||
}
|
||||
|
||||
getMaxLevel() {
|
||||
@ -181,7 +181,7 @@ var StreamSlider = class {
|
||||
if (this._allowAmplified)
|
||||
maxVolume = this._control.get_vol_max_amplified();
|
||||
|
||||
return 100 * maxVolume / this._control.get_vol_max_norm();
|
||||
return maxVolume / this._control.get_vol_max_norm();
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(StreamSlider.prototype);
|
||||
@ -363,8 +363,8 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
||||
return result;
|
||||
|
||||
let gicon = new Gio.ThemedIcon({ name: this._volumeMenu.getIcon() });
|
||||
let level = parseInt(this._volumeMenu.getLevel());
|
||||
let maxLevel = parseInt(this._volumeMenu.getMaxLevel());
|
||||
let level = this._volumeMenu.getLevel();
|
||||
let maxLevel = this._volumeMenu.getMaxLevel();
|
||||
Main.osdWindowManager.show(-1, gicon, null, level, maxLevel);
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user