Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 3baa087..a483434 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -245,23 +245,12 @@ void VideoWidget::updateSlider( long i, long max ) { | |||
245 | void VideoWidget::setToggleButton( int i, bool down ) { | 245 | void VideoWidget::setToggleButton( int i, bool down ) { |
246 | if ( down != buttons[i].isDown ) { | 246 | if ( down != buttons[i].isDown ) { |
247 | toggleButton( i ); | 247 | toggleButton( i ); |
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||
251 | void VideoWidget::paintButton( QPainter &p, int i ) { | ||
252 | |||
253 | Button &button = buttons[ i ]; | ||
254 | |||
255 | if ( button.isDown ) { | ||
256 | p.drawPixmap( upperLeftOfButtonMask, button.pixDown ); | ||
257 | } else { | ||
258 | p.drawPixmap( upperLeftOfButtonMask, button.pixUp ); | ||
259 | } | ||
260 | } | ||
261 | |||
262 | void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | 251 | void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { |
263 | for ( unsigned int i = 0; i < buttons.count(); i++ ) { | 252 | for ( unsigned int i = 0; i < buttons.count(); i++ ) { |
264 | if ( event->state() == QMouseEvent::LeftButton ) { | 253 | if ( event->state() == QMouseEvent::LeftButton ) { |
265 | // The test to see if the mouse click is inside the button or not | 254 | // The test to see if the mouse click is inside the button or not |
266 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); | 255 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); |
267 | 256 | ||
@@ -400,20 +389,20 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { | |||
400 | // Combine with background and double buffer | 389 | // Combine with background and double buffer |
401 | QPixmap pix( pe->rect().size() ); | 390 | QPixmap pix( pe->rect().size() ); |
402 | QPainter p( &pix ); | 391 | QPainter p( &pix ); |
403 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 392 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
404 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); | 393 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); |
405 | for ( unsigned int i = 0; i < buttons.count(); i++ ) { | 394 | for ( unsigned int i = 0; i < buttons.count(); i++ ) { |
406 | paintButton( p, i ); | 395 | paintButton( p, buttons[ i ] ); |
407 | } | 396 | } |
408 | QPainter p2( this ); | 397 | QPainter p2( this ); |
409 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 398 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
410 | } else { | 399 | } else { |
411 | QPainter p( this ); | 400 | QPainter p( this ); |
412 | for ( unsigned int i = 0; i < buttons.count(); i++ ) | 401 | for ( unsigned int i = 0; i < buttons.count(); i++ ) |
413 | paintButton( p, i ); | 402 | paintButton( p, buttons[ i ] ); |
414 | } | 403 | } |
415 | //slider->repaint( TRUE ); | 404 | //slider->repaint( TRUE ); |
416 | } | 405 | } |
417 | } | 406 | } |
418 | 407 | ||
419 | 408 | ||