diff --git a/res/skins/Deere/icon/ic_battery_unknown_48px.svg b/res/skins/Deere/icon/ic_battery_unknown_48px.svg deleted file mode 100644 index 071595e2d16..00000000000 --- a/res/skins/Deere/icon/ic_battery_unknown_48px.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/res/skins/Deere/tool_bar.xml b/res/skins/Deere/tool_bar.xml index 6a5f87c07a2..397885f8447 100644 --- a/res/skins/Deere/tool_bar.xml +++ b/res/skins/Deere/tool_bar.xml @@ -15,7 +15,6 @@ Battery 24,24 f,f - icon/ic_battery_unknown_48px.svg icon/ic_battery_charged_48px.svg 8 icon/ic_battery_charging_%1_48px.svg diff --git a/res/skins/Tango/graphics/batt/ic_battery_unknown.svg b/res/skins/Tango/graphics/batt/ic_battery_unknown.svg deleted file mode 100644 index 269589e46ba..00000000000 --- a/res/skins/Tango/graphics/batt/ic_battery_unknown.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/res/skins/Tango/topbar.xml b/res/skins/Tango/topbar.xml index 009e97b962e..34367255e0b 100644 --- a/res/skins/Tango/topbar.xml +++ b/res/skins/Tango/topbar.xml @@ -283,7 +283,6 @@ Description: Battery 24,24 f,f - graphics/batt/ic_battery_unknown.svg graphics/batt/ic_battery_charged.svg 8 graphics/batt/ic_battery_charging_%1.svg diff --git a/src/widget/wbattery.cpp b/src/widget/wbattery.cpp index 70b6d6cf1dc..afb3bb82831 100644 --- a/src/widget/wbattery.cpp +++ b/src/widget/wbattery.cpp @@ -8,6 +8,7 @@ WBattery::WBattery(QWidget* parent) : WWidget(parent), m_pBattery(Battery::getBattery(this)) { + setVisible(false); if (m_pBattery) { connect(m_pBattery.data(), SIGNAL(stateChanged()), this, SLOT(update())); @@ -23,14 +24,6 @@ void WBattery::setup(const QDomNode& node, const SkinContext& context) { context.getScaleFactor()); } - QDomElement unknownPath = context.selectElement(node, "PixmapUnknown"); - if (!unknownPath.isNull()) { - setPixmap(&m_pPixmapUnknown, - context.getPixmapSource(unknownPath), - context.selectScaleMode(unknownPath, Paintable::TILE), - context.getScaleFactor()); - } - QDomElement chargedPath = context.selectElement(node, "PixmapCharged"); if (!chargedPath.isNull()) { setPixmap(&m_pPixmapCharged, @@ -99,9 +92,8 @@ void WBattery::update() { if (chargingState != Battery::UNKNOWN) { setBaseTooltip(QString("%1\%").arg(dPercentage, 0, 'f', 0)); - } else { - setBaseTooltip(tr("Battery status unknown.")); } + m_pCurrentPixmap.clear(); switch (chargingState) { case Battery::CHARGING: @@ -130,11 +122,10 @@ void WBattery::update() { m_pCurrentPixmap = m_pPixmapCharged; appendBaseTooltip("\n" + tr("Battery fully charged.")); break; - case Battery::UNKNOWN: default: - m_pCurrentPixmap = m_pPixmapUnknown; break; } + setVisible(chargingState != Battery::UNKNOWN); // call parent's update() to show changes, this should call // QWidget::update()