Skip to content

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.

Merge request reports