author | simon <simon> | 2002-12-09 15:31:35 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 15:31:35 (UTC) |
commit | 159a3334ecd168f422afe81853998373457fefa0 (patch) (side-by-side diff) | |
tree | 2672138cdabca5b73f3828d3b88b31bb1b280c67 /noncore/multimedia/opieplayer2/mediawidget.cpp | |
parent | ab22599627d84a6c6427d2440da4271b48f47c8e (diff) | |
download | opie-159a3334ecd168f422afe81853998373457fefa0.zip opie-159a3334ecd168f422afe81853998373457fefa0.tar.gz opie-159a3334ecd168f422afe81853998373457fefa0.tar.bz2 |
- minor cleanup in paintEvent
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (show 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 ) QPainter p( &pix ); p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() ); - for ( unsigned int i = 0; i < buttons.count(); i++ ) { - paintButton( p, buttons[ i ] ); - } + paintAllButtons( p ); QPainter p2( this ); p2.drawPixmap( pe->rect().topLeft(), pix ); } else { QPainter p( this ); - for ( unsigned int i = 0; i < buttons.count(); i++ ) - paintButton( p, buttons[ i ] ); + paintAllButtons( p ); } } @@ -96,6 +93,13 @@ bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 ); } +void MediaWidget::paintAllButtons( QPainter &p ) +{ + for ( ButtonMap::ConstIterator it = buttons.begin(); + it != buttons.end(); ++it ) + paintButton( *it ); +} + void MediaWidget::paintButton( const Button &button ) { QPainter p( this ); |