Skip to content

Commit

Permalink
Fix scaling of the battery widget icons
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrapha committed Jun 13, 2019
1 parent 5fb3542 commit 60c9a2e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/widget/wbattery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ void WBattery::setPixmap(PaintablePointer* ppPixmap, const PixmapSource& source,
qDebug() << this << "Error loading pixmap:" << source.getPath();
} else {
*ppPixmap = pPixmap;
setFixedSize(pPixmap->size());
if (mode == Paintable::FIXED) {
setFixedSize(pPixmap->size());
}
}
}

Expand All @@ -159,10 +161,10 @@ void WBattery::paintEvent(QPaintEvent* /*unused*/) {
p.drawPrimitive(QStyle::PE_Widget, option);

if (m_pPixmapBack) {
m_pPixmapBack->draw(0, 0, &p);
m_pPixmapBack->draw(rect(), &p);
}

if (m_pCurrentPixmap) {
m_pCurrentPixmap->draw(0, 0, &p);
m_pCurrentPixmap->draw(rect(), &p);
}
}

0 comments on commit 60c9a2e

Please sign in to comment.