Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index b73a5c0..271f788 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -60,15 +60,12 @@ void MediaWidget::paintEvent( QPaintEvent *pe ) | |||
60 | QPainter p( &pix ); | 60 | QPainter p( &pix ); |
61 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 61 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
62 | p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() ); | 62 | p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() ); |
63 | for ( unsigned int i = 0; i < buttons.count(); i++ ) { | 63 | paintAllButtons( p ); |
64 | paintButton( p, buttons[ i ] ); | ||
65 | } | ||
66 | QPainter p2( this ); | 64 | QPainter p2( this ); |
67 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 65 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
68 | } else { | 66 | } else { |
69 | QPainter p( this ); | 67 | QPainter p( this ); |
70 | for ( unsigned int i = 0; i < buttons.count(); i++ ) | 68 | paintAllButtons( p ); |
71 | paintButton( p, buttons[ i ] ); | ||
72 | } | 69 | } |
73 | } | 70 | } |
74 | 71 | ||
@@ -96,6 +93,13 @@ bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const | |||
96 | buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 ); | 93 | buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 ); |
97 | } | 94 | } |
98 | 95 | ||
96 | void MediaWidget::paintAllButtons( QPainter &p ) | ||
97 | { | ||
98 | for ( ButtonMap::ConstIterator it = buttons.begin(); | ||
99 | it != buttons.end(); ++it ) | ||
100 | paintButton( *it ); | ||
101 | } | ||
102 | |||
99 | void MediaWidget::paintButton( const Button &button ) | 103 | void MediaWidget::paintButton( const Button &button ) |
100 | { | 104 | { |
101 | QPainter p( this ); | 105 | QPainter p( this ); |