Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion res/skins/Deere/icon/ic_battery_unknown_48px.svg

This file was deleted.

1 change: 0 additions & 1 deletion res/skins/Deere/tool_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<ObjectName>Battery</ObjectName>
<Size>24,24</Size>
<SizePolicy>f,f</SizePolicy>
<PixmapUnknown scalemode="STRETCH_ASPECT">icon/ic_battery_unknown_48px.svg</PixmapUnknown>
<PixmapCharged scalemode="STRETCH_ASPECT">icon/ic_battery_charged_48px.svg</PixmapCharged>
<NumberStates>8</NumberStates>
<PixmapsCharging scalemode="STRETCH_ASPECT">icon/ic_battery_charging_%1_48px.svg</PixmapsCharging>
Expand Down
1 change: 0 additions & 1 deletion res/skins/Tango/graphics/batt/ic_battery_unknown.svg

This file was deleted.

1 change: 0 additions & 1 deletion res/skins/Tango/topbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ Description:
<ObjectName>Battery</ObjectName>
<Size>24,24</Size>
<SizePolicy>f,f</SizePolicy>
<PixmapUnknown scalemode="STRETCH_ASPECT">graphics/batt/ic_battery_unknown.svg</PixmapUnknown>
<PixmapCharged scalemode="STRETCH_ASPECT">graphics/batt/ic_battery_charged.svg</PixmapCharged>
<NumberStates>8</NumberStates>
<PixmapsCharging scalemode="STRETCH_ASPECT">graphics/batt/ic_battery_charging_%1.svg</PixmapsCharging>
Expand Down
15 changes: 3 additions & 12 deletions src/widget/wbattery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down