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.
The pending-charge state means AC power is on but the battery is not
being charged. This can happen because its charge is above a certain
threshold, to avoid short charging cycles and prolong the battery's
life, or because the PSU is not powerful enough to charge the batteries.
Instead of lying to the user about something being estimated, we should
simply tell the truth and set the label to "Not Charging".
Closes: #249.
The code to lookup or insert items into the combobox had a few issues.
It would assume that the items are sorted, causing existing items to not
be found and be inserted instead. It also would simply forget to insert
an item if it was larger than all existing items.
This code is now changed to iterate over all items, finding the best
insertion point in the process (next item has a larger value, or the
values are not increasing anymore). The item will only be inserted if it
has not been found.
Fixes#261
The Wi-Fi and mobile broadband row's visibility depends on related
device status. But calling gtk_widget_show_all on the whole list box
makes them visible even related device is not avialbe. Fix that by
setting no-show-all of these two widgets as TRUE.
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/189
Objects created using the object storage API are not disposed when the panel
that created them is disposed. In order to prevent segfaults we need to manually
disconnect signal handler connected to these objects or we can do it
automatically using g_signal_connect_object.
Fixes: https://launchpad.net/bugs/1797205
The code must not access the passed panel if the operation to create the
keyboard proxy has been cancelled. This fixes a possible crash when
switching away from the power panel.
The battery power level level bars are using the default offsets for low, high and full battery level, 0.25, 0.75 and 1.0.
Based on the suggestion from #68, this commit changes the high and full offset to 0.1 and 0.8, and the low battery level offset to 0.03 for primary batteries and UPSs, and 0.05 for other batteries and devices.
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/68