[gnome-shell] status/power: Always show real percentage in battery label
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] status/power: Always show real percentage in battery label
- Date: Tue, 27 Apr 2021 19:09:18 +0000 (UTC)
commit 6ee2c4f74c09a6fe3d79beb70e052f31e049e3f5
Author: Prajna Sariputra <putr4 s gmail com>
Date: Thu Apr 1 20:20:29 2021 +1100
status/power: Always show real percentage in battery label
We currently display the percentage as "100%" if the battery state is
"fully charged", but the actual capacity may be lower than that.
Just show the real percentage, which is consistent with Settings.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3393
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1787>
js/ui/status/power.js | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/js/ui/status/power.js b/js/ui/status/power.js
index 0e8471fdfa..304f68d47e 100644
--- a/js/ui/status/power.js
+++ b/js/ui/status/power.js
@@ -134,11 +134,7 @@ class Indicator extends PanelMenu.SystemIndicator {
this._item.icon.fallback_icon_name = fallbackIcon;
// The icon label
- let label;
- if (this._proxy.State == UPower.DeviceState.FULLY_CHARGED)
- label = _("%d\u2009%%").format(100);
- else
- label = _("%d\u2009%%").format(this._proxy.Percentage);
+ const label = _('%d\u2009%%').format(this._proxy.Percentage);
this._percentageLabel.text = label;
// The status label
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]