OTHER: Fix graphic glitch if PLAYPAUS is less than 9 pixels high

This commit is contained in:
Thomas Frauendorfer 2008-10-29 01:20:33 +01:00
parent 866833ebec
commit 5c4a080fbf
3 changed files with 16 additions and 14 deletions

View file

@ -13,8 +13,6 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include <iostream>
#include "Skin.h" #include "Skin.h"
#include <QDir> #include <QDir>
@ -628,26 +626,27 @@ Skin::BuildOther (void)
img = getPixmap("playpaus"); img = getPixmap("playpaus");
if(img) if(img)
{ {
part = new QPixmap(11, 9); int h = qMin (img->height (), 9);
part = new QPixmap(11, h);
painter.begin(part); painter.begin(part);
painter.drawPixmap (0, 0, 3, 9, *img, 36, 0, 3, 9); painter.drawPixmap (0, 0, 3, h, *img, 36, 0, 3, h);
painter.drawPixmap (3, 0, 8, 9, *img, 1, 0, 8, 9); painter.drawPixmap (3, 0, 8, h, *img, 1, 0, 8, h);
painter.end(); painter.end();
m_items[PIC_PLAY] = part->copy(); m_items[PIC_PLAY] = part->copy();
delete part; delete part;
part = new QPixmap(11, 9); part = new QPixmap(11, h);
painter.begin(part); painter.begin(part);
painter.drawPixmap (0, 0, 2, 9, *img, 27, 0, 2, 9); painter.drawPixmap (0, 0, 2, h, *img, 27, 0, 2, h);
painter.drawPixmap (2, 0, 9, 9, *img, 9, 0, 9, 9); painter.drawPixmap (2, 0, 9, h, *img, 9, 0, 9, h);
painter.end(); painter.end();
m_items[PIC_PAUSE] = part->copy(); m_items[PIC_PAUSE] = part->copy();
delete part; delete part;
part = new QPixmap(11, 9); part = new QPixmap(11, h);
painter.begin(part); painter.begin(part);
painter.drawPixmap (0, 0, 2, 9, *img, 27, 0, 2, 9); painter.drawPixmap (0, 0, 2, h, *img, 27, 0, 2, h);
painter.drawPixmap (2, 0, 9, 9, *img, 18, 0, 9, 9); painter.drawPixmap (2, 0, 9, h, *img, 18, 0, 9, h);
painter.end(); painter.end();
m_items[PIC_STOP] = part->copy(); m_items[PIC_STOP] = part->copy();
delete part; delete part;

View file

@ -50,8 +50,7 @@ class Skin : public QObject
const QPixmap getItem (uint part) const { return m_items[part]; } const QPixmap getItem (uint part) const { return m_items[part]; }
const QPixmap getPls (uint part) const { return m_playlist[part]; } const QPixmap getPls (uint part) const { return m_playlist[part]; }
const QPixmap getLetter (uint c) const { return m_letterMap[c]; } const QPixmap getLetter (uint c) const { return m_letterMap[c]; }
const QPixmap getNumber (uint c) const { return m_numbers[c]; } // const QPixmap getNumber (uint c) const { return m_numbers[c]; }
uint getNumberSize () { return m_numbers.size(); }
const QByteArray getPLeditValue (QByteArray c) const { return m_pledit_txt[c]; } const QByteArray getPLeditValue (QByteArray c) const { return m_pledit_txt[c]; }
enum Part { enum Part {

View file

@ -39,12 +39,16 @@ PlayStatus::setPixmaps (Skin *skin)
m_pixmap_pause = skin->getItem (Skin::PIC_PAUSE); m_pixmap_pause = skin->getItem (Skin::PIC_PAUSE);
m_pixmap_stop = skin->getItem (Skin::PIC_STOP); m_pixmap_stop = skin->getItem (Skin::PIC_STOP);
setFixedSize(11, m_pixmap_play.height ());
update (); update ();
} }
void void
PlayStatus::setStatus (Xmms::Playback::Status status) PlayStatus::setStatus (Xmms::Playback::Status status)
{ {
if (m_status == status)
return;
m_status = status; m_status = status;
update (); update ();
} }
@ -71,7 +75,7 @@ PlayStatus::paintEvent (QPaintEvent *event)
QPainter p; QPainter p;
p.begin (this); p.begin (this);
p.drawPixmap (rect (), pixmap, pixmap.rect ()); p.drawPixmap (rect (), pixmap);
p.end (); p.end ();
} }