OTHER: Fix graphic glitch if PLAYPAUS is less than 9 pixels high
This commit is contained in:
parent
866833ebec
commit
5c4a080fbf
3 changed files with 16 additions and 14 deletions
21
src/Skin.cpp
21
src/Skin.cpp
|
@ -13,8 +13,6 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "Skin.h"
|
||||
|
||||
#include <QDir>
|
||||
|
@ -628,26 +626,27 @@ Skin::BuildOther (void)
|
|||
img = getPixmap("playpaus");
|
||||
if(img)
|
||||
{
|
||||
part = new QPixmap(11, 9);
|
||||
int h = qMin (img->height (), 9);
|
||||
part = new QPixmap(11, h);
|
||||
painter.begin(part);
|
||||
painter.drawPixmap (0, 0, 3, 9, *img, 36, 0, 3, 9);
|
||||
painter.drawPixmap (3, 0, 8, 9, *img, 1, 0, 8, 9);
|
||||
painter.drawPixmap (0, 0, 3, h, *img, 36, 0, 3, h);
|
||||
painter.drawPixmap (3, 0, 8, h, *img, 1, 0, 8, h);
|
||||
painter.end();
|
||||
m_items[PIC_PLAY] = part->copy();
|
||||
delete part;
|
||||
|
||||
part = new QPixmap(11, 9);
|
||||
part = new QPixmap(11, h);
|
||||
painter.begin(part);
|
||||
painter.drawPixmap (0, 0, 2, 9, *img, 27, 0, 2, 9);
|
||||
painter.drawPixmap (2, 0, 9, 9, *img, 9, 0, 9, 9);
|
||||
painter.drawPixmap (0, 0, 2, h, *img, 27, 0, 2, h);
|
||||
painter.drawPixmap (2, 0, 9, h, *img, 9, 0, 9, h);
|
||||
painter.end();
|
||||
m_items[PIC_PAUSE] = part->copy();
|
||||
delete part;
|
||||
|
||||
part = new QPixmap(11, 9);
|
||||
part = new QPixmap(11, h);
|
||||
painter.begin(part);
|
||||
painter.drawPixmap (0, 0, 2, 9, *img, 27, 0, 2, 9);
|
||||
painter.drawPixmap (2, 0, 9, 9, *img, 18, 0, 9, 9);
|
||||
painter.drawPixmap (0, 0, 2, h, *img, 27, 0, 2, h);
|
||||
painter.drawPixmap (2, 0, 9, h, *img, 18, 0, 9, h);
|
||||
painter.end();
|
||||
m_items[PIC_STOP] = part->copy();
|
||||
delete part;
|
||||
|
|
|
@ -50,8 +50,7 @@ class Skin : public QObject
|
|||
const QPixmap getItem (uint part) const { return m_items[part]; }
|
||||
const QPixmap getPls (uint part) const { return m_playlist[part]; }
|
||||
const QPixmap getLetter (uint c) const { return m_letterMap[c]; }
|
||||
const QPixmap getNumber (uint c) const { return m_numbers[c]; }
|
||||
uint getNumberSize () { return m_numbers.size(); }
|
||||
// const QPixmap getNumber (uint c) const { return m_numbers[c]; }
|
||||
const QByteArray getPLeditValue (QByteArray c) const { return m_pledit_txt[c]; }
|
||||
|
||||
enum Part {
|
||||
|
|
|
@ -39,12 +39,16 @@ PlayStatus::setPixmaps (Skin *skin)
|
|||
m_pixmap_pause = skin->getItem (Skin::PIC_PAUSE);
|
||||
m_pixmap_stop = skin->getItem (Skin::PIC_STOP);
|
||||
|
||||
setFixedSize(11, m_pixmap_play.height ());
|
||||
update ();
|
||||
}
|
||||
|
||||
void
|
||||
PlayStatus::setStatus (Xmms::Playback::Status status)
|
||||
{
|
||||
if (m_status == status)
|
||||
return;
|
||||
|
||||
m_status = status;
|
||||
update ();
|
||||
}
|
||||
|
@ -71,7 +75,7 @@ PlayStatus::paintEvent (QPaintEvent *event)
|
|||
|
||||
QPainter p;
|
||||
p.begin (this);
|
||||
p.drawPixmap (rect (), pixmap, pixmap.rect ());
|
||||
p.drawPixmap (rect (), pixmap);
|
||||
p.end ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue