[apps] Return boolean when charging state or charge level has changed

(to know if the redrawing is necessary)

Change-Id: Iebb1d2ba1f188815b01bcbd6e632244f6169b3f9
This commit is contained in:
Émilie Feral
2017-04-07 11:35:47 +02:00
parent 34464816e0
commit ab128b73dd
6 changed files with 20 additions and 22 deletions

View File

@@ -18,18 +18,22 @@ BatteryView::BatteryView() :
{
}
void BatteryView::setChargeState(Ion::Battery::Charge chargeState) {
bool BatteryView::setChargeState(Ion::Battery::Charge chargeState) {
if (chargeState != m_chargeState) {
m_chargeState = chargeState;
markRectAsDirty(bounds());
return true;
}
return false;
}
void BatteryView::setIsCharging(bool isCharging) {
bool BatteryView::setIsCharging(bool isCharging) {
if (m_isCharging != isCharging) {
m_isCharging = isCharging;
markRectAsDirty(bounds());
return true;
}
return false;
}
KDColor s_flashWorkingBuffer[BatteryView::k_flashHeight*BatteryView::k_flashWidth];