[AGS] Improve Battery display
This commit is contained in:
		| @@ -29,11 +29,13 @@ export const BatteryBox = () => { | ||||
|                 cssClasses={["battery-time"]} | ||||
|                 visible={bind(battery, "charging").as(c => !c)} | ||||
|                 label={bind(battery, "timeToEmpty").as(t => `(${toTime(t)})`)} | ||||
|                 tooltipText={bind(battery, 'energyRate').as(er => `Time to empty. Power usage: ${batteryEnergy(er)}`)} | ||||
|             /> | ||||
|             <label | ||||
|                 cssClasses={["battery-time"]} | ||||
|                 visible={bind(battery, "charging")} | ||||
|                 label={bind(battery, "timeToFull").as(t => `(${toTime(t)})`)} | ||||
|                 tooltipText={bind(battery, 'energyRate').as(er => `Time to full. Charge rate: ${batteryEnergy(er)}`)} | ||||
|             /> | ||||
|         </box> | ||||
|     ); | ||||
| @@ -43,7 +45,7 @@ const toTime = (time: number) => { | ||||
|     const MINUTE = 60; | ||||
|     const HOUR = MINUTE * 60; | ||||
|  | ||||
|     if (time > 24 * HOUR) return ""; | ||||
|     if (time > 24 * HOUR) return "24h+"; | ||||
|  | ||||
|     const hours = Math.round(time / HOUR); | ||||
|     const minutes = Math.round((time - hours * HOUR) / MINUTE); | ||||
|   | ||||
| @@ -127,7 +127,7 @@ const BatteryWidget = () => { | ||||
|             <image | ||||
|                 iconName={bind(battery, "batteryIconName").as(icon => icon)} | ||||
|                 cssClasses={["quick-view-symbol"]} | ||||
|                 tooltipText={bind(battery, 'percentage').as(p => `${Math.round(p * 100)}%`)} | ||||
|                 tooltipText={bind(battery, 'percentage').as(p => `Battery Level: ${Math.round(p * 100)}%`)} | ||||
|             ></image> | ||||
|         ); | ||||
|     } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user