If you can't suspend/hibernate or on a mobile device or VM then the battery
percentage is control is supposed to be shown.
The parent widgets are hidden though, so this doesn't work.
Always show the parents, as all branches show something here.
This was added in 6a65dcf693.
Calling gtk_css_provider_load_from_resource() twice will remove any
already loaded resource instead of adding the new CSS with the old. Load
each CSS individually instead.
Fixes: f1bcaf1fbc
It seems this was added in ee36b0df91, but the `status` variable has
been unused since a9683772d9 (committed in 2012).
Seems safe to remove if it's been unused since 2012.
`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.
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
This matches the preferences available in a lot of other OSes, whether
desktop or mobile, and can help with identifying the state of the
battery quicker for some people, as a number might be parsed quicker
than an icon/colour combination.
Closes: #481
(gnome-control-center:172393): libupower-glib-WARNING **: 15:00:10.866: Property ID 'power-supply' (6) was never set
(gnome-control-center:172393): libupower-glib-WARNING **: 15:00:10.866: Property ID 'is-present' (8) was never set
(gnome-control-center:172393): libupower-glib-WARNING **: 15:00:10.866: Property ID 'battery-level' (28) was never set
(gnome-control-center:174498): libupower-glib-WARNING **: 15:04:44.859: Property ID 'time-to-full' (24) was never set
Let the power switch be active (ie, powersave set to off) if either
of wimax or wwan device is enabled. And set the switch sensitive
if either of them present.
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
The GtkScale widget for screen brightness has a tendency to jump around
because GtkRange defaults to NOT rounding values (round_digits = -1).
This means that the widget is constantly set with values that have
decimals (say 10.3) which it then tries to correct to fit the step size.
The solution for this particular UI quirk is to make sure to set
round-digits to 0, as that will force GtkRange to provide GtkScale with
rounded-down numbers. See gtkrange.c.
Fixes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/405
The previous code would have leaked all the UpDevice objects because no
free function was set on the returned GPtrArray.
Since we already depend on upower-glib 0.99.8 which is the release in
which get_devices() was deprecated and get_devices2() was introduced, we
can simply switch to get_devices2() which does set a free function on
the returned GPtrArray, stopping the leak.
* Add another vertical size group handling only battery
rows.
* Add more vertical margins to the battery rows -- set
to 16px and 14px, respectivelly, the top and bottom
margins.
* Increase spacing between battery level and labels to
10px.
* Increase spacing between titles and subtitles to 4px.
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/553
This factorizes the row creation a bit and normalizes the margins and
spacing, reducing the required width. This also makes labels like row
titles and descriptions ellipsizable so the rows can reach narrower
widths.