diff options
author | Raphael Graf <r@undefined.ch> | 2019-06-13 22:40:05 +0200 |
---|---|---|
committer | Raphael Graf <r@undefined.ch> | 2019-06-13 23:01:09 +0200 |
commit | 60c9a2e71f17bf156288b11e4d69dabc1b352b03 (patch) | |
tree | 226dcb4b19cfa2453b62fc25961b4fd4e634e2c5 /src/widget | |
parent | 5fb35422d6a4f1f947faeeb9c6f14b1c93502282 (diff) |
Fix scaling of the battery widget icons
Diffstat (limited to 'src/widget')
-rw-r--r-- | src/widget/wbattery.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widget/wbattery.cpp b/src/widget/wbattery.cpp index aa647e9e68..c7abe4ea16 100644 --- a/src/widget/wbattery.cpp +++ b/src/widget/wbattery.cpp @@ -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()); + } } } @@ -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); } } |