Commit graph

7 commits

Author SHA1 Message Date
Bastien Nocera
e5bbe4d7c6 power: Add new power profile info row widget 2021-07-15 22:14:06 +02:00
Robert Ancell
2dbab9d4fa power: Use GtkBuilder for CcPowerProfileRow 2021-01-06 20:02:46 +00:00
Bastien Nocera
f1bcaf1fbc power: Add "Power Mode" section
Use power-profiles-daemon[1] to implement switchable power profiles.
The performance profile will only be available on systems which provide
this functionality.

[1]: https://gitlab.freedesktop.org/hadess/power-profiles-daemon
2020-10-29 16:58:24 +01:00
Ian Douglas Scott
f297f544f1 power: Refactor battery row code into a CcBatteryRow type
`set_primary()` and `add_primary()` had a lot of redundant code. This
unifies them, and moves them to a custom widget called `CcBatteryRow`.
This also decreases the somewhat excessive size of `cc-power-panel.c`,
and makes it easier to see the layout of widgets, now that it's
specified in xml.

Before this, `warning-battery-offset` was set to `0.03` for a "primary"
battery, and `0.05` otherwise. I expect this is a bug, so I've changed
both to `0.03`.

No other style or behavior change is intended.
2020-10-14 22:56:16 +00:00
Bastien Nocera
2397d0c082 power: Use correct colour for battery level bars
Use 3 symbolic colours to paint the levels in the battery bars, with a
red "error" colour used for the lowest level of battery, an orange
"warning" colour for the pre-error level, and a green "success" colour
used for levels above that.

There's no yellow intermediate colour as this is usually too anxiety
inducing and there's no real need to press users into a "warning"
behaviour when the level will still be comfortable for a long enough
time.

Closes: #725
2020-07-06 17:27:49 +02:00
Robert Ancell
e6bf2870c1 power: Make .ui filename match the .c filename 2018-11-12 16:41:01 +00:00
Cosimo Cecchi
645778eaee power: use a GResource for GtkBuilder UI definition
https://bugzilla.gnome.org/show_bug.cgi?id=691132
2013-01-07 11:10:14 +01:00