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:
verdre
2019-02-02 17:50:04 +01:00
committed by Florian Müllner
parent 86c3909908
commit cb0d28770f
3 changed files with 16 additions and 10 deletions

View File

@ -94,6 +94,12 @@ var GnomeShell = class {
if (serializedIcon)
icon = Gio.Icon.new_for_string(serializedIcon);
// Translate from percentages in the D-Bus API to floats
if (!isNaN(level))
level /= 100;
if (!isNaN(maxLevel))
maxLevel /= 100;
Main.osdWindowManager.show(monitorIndex, icon, label, level, maxLevel);
}