diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-07-31 08:11:52 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-07-31 08:11:52 +0000 |
| commit | d0d4944e58f3673b3083f1e27ff19c51a24e58d9 (patch) | |
| tree | 90ee231131e42562d15e4a7f6a0e8a661d267a29 /src/plugins/Ui/skinned/skin.cpp | |
| parent | 6e77f148bdc28b68a6935ff29b2a4a44adfb7140 (diff) | |
| download | qmmp-d0d4944e58f3673b3083f1e27ff19c51a24e58d9.tar.gz qmmp-d0d4944e58f3673b3083f1e27ff19c51a24e58d9.tar.bz2 qmmp-d0d4944e58f3673b3083f1e27ff19c51a24e58d9.zip | |
fixed problems with some skins (#790)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5283 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/skinned/skin.cpp')
| -rw-r--r-- | src/plugins/Ui/skinned/skin.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/Ui/skinned/skin.cpp b/src/plugins/Ui/skinned/skin.cpp index b8a0a78f0..97c3c5a62 100644 --- a/src/plugins/Ui/skinned/skin.cpp +++ b/src/plugins/Ui/skinned/skin.cpp @@ -231,6 +231,7 @@ void Skin::loadColors() void Skin::loadButtons() { QPixmap *pixmap = getPixmap ("cbuttons"); + pixmap = correctSize(pixmap, 136, pixmap->height()); m_buttons[BT_PREVIOUS_N] = pixmap->copy (0, 0,23,18); m_buttons[BT_PREVIOUS_P] = pixmap->copy (0,18,23,18); @@ -288,7 +289,7 @@ void Skin::loadPosBar() m_buttons[BT_POSBAR_N] = dummy; m_buttons[BT_POSBAR_P] = dummy; } - posbar = pixmap->copy (0,0,248,pixmap->height()); + posbar = pixmap->copy (0,0,248, qMin(pixmap->height(), 10)); delete pixmap; } @@ -457,6 +458,7 @@ void Skin::loadPLEdit() void Skin::loadEqMain() { QPixmap *pixmap = getPixmap ("eqmain"); + pixmap = correctSize(pixmap, pixmap->width(), 292); m_eq_parts[ EQ_MAIN ] = pixmap->copy (0,0,275,116); m_eq_parts[ EQ_TITLEBAR_A ] = pixmap->copy (0,134,275,14); @@ -793,6 +795,20 @@ QRegion Skin::createRegion(const QString &path, const QString &key) return region; } +QPixmap *Skin::correctSize(QPixmap *pixmap, int w, int h) +{ + if(pixmap->width() < w || pixmap->height() < h) + { + QPixmap *fullSizePixmap = new QPixmap(w, h); + fullSizePixmap->fill(Qt::transparent); + QPainter p(fullSizePixmap); + p.drawPixmap(0,0,*pixmap); + delete pixmap; + return fullSizePixmap; + } + return pixmap; +} + QPixmap * Skin::getDummyPixmap(const QString &name, const QString &fallback) { QDir dir (":/glare"); |
