[AGS] Battery, Brightness: Improve design

This commit is contained in:
Janis Hutz 2025-04-26 13:29:16 +02:00
parent 678afa99d6
commit 86e963e408
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,5 @@
import { bind } from "astal";
import Battery from "gi://AstalBattery";
import { Gtk } from "astal/gtk4";
export const BatteryBox = () => {
const battery = Battery.get_default();
@ -26,10 +25,15 @@ export const BatteryBox = () => {
)}
/>
<label
cssClasses={["time"]}
cssClasses={["battery-time"]}
visible={bind(battery, "charging").as(c => !c)}
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>
);
};

View File

@ -12,7 +12,7 @@ const BrightnessModule = () => {
<image iconName={"brightness-high-symbolic"}></image>
<label label={bind(brightness, "screen").as(b => `${Math.round(100 * b)}%`)}></label>
<slider
value={bind(brightness, "screen").as(b => Math.round(100 * b))}
value={bind(brightness, "screen").as(b => 100 * b)}
hexpand
max={100}
min={0}