[AGS] Battery, Brightness: Improve design
This commit is contained in:
		| @@ -1,6 +1,5 @@ | |||||||
| import { bind } from "astal"; | import { bind } from "astal"; | ||||||
| import Battery from "gi://AstalBattery"; | import Battery from "gi://AstalBattery"; | ||||||
| import { Gtk } from "astal/gtk4"; |  | ||||||
|  |  | ||||||
| export const BatteryBox = () => { | export const BatteryBox = () => { | ||||||
|     const battery = Battery.get_default(); |     const battery = Battery.get_default(); | ||||||
| @@ -26,10 +25,15 @@ export const BatteryBox = () => { | |||||||
|                 )} |                 )} | ||||||
|             /> |             /> | ||||||
|             <label |             <label | ||||||
|                 cssClasses={["time"]} |                 cssClasses={["battery-time"]} | ||||||
|                 visible={bind(battery, "charging").as(c => !c)} |                 visible={bind(battery, "charging").as(c => !c)} | ||||||
|                 label={bind(battery, "timeToEmpty").as(t => `(${toTime(t)})`)} |                 label={bind(battery, "timeToEmpty").as(t => `(${toTime(t)})`)} | ||||||
|             /> |             /> | ||||||
|  |             <label | ||||||
|  |                 cssClasses={["battery-time"]} | ||||||
|  |                 visible={bind(battery, "charging")} | ||||||
|  |                 label={bind(battery, "timeToFull").as(t => `(${toTime(t)})`)} | ||||||
|  |             /> | ||||||
|         </box> |         </box> | ||||||
|     ); |     ); | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ const BrightnessModule = () => { | |||||||
|             <image iconName={"brightness-high-symbolic"}></image> |             <image iconName={"brightness-high-symbolic"}></image> | ||||||
|             <label label={bind(brightness, "screen").as(b => `${Math.round(100 * b)}%`)}></label> |             <label label={bind(brightness, "screen").as(b => `${Math.round(100 * b)}%`)}></label> | ||||||
|             <slider |             <slider | ||||||
|                 value={bind(brightness, "screen").as(b => Math.round(100 * b))} |                 value={bind(brightness, "screen").as(b => 100 * b)} | ||||||
|                 hexpand |                 hexpand | ||||||
|                 max={100} |                 max={100} | ||||||
|                 min={0} |                 min={0} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user