summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/videowidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp15
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
@@ -239,35 +239,24 @@ void VideoWidget::updateSlider( long i, long max ) {
if ( slider->maxValue() != width ) {
slider->setMaxValue( width );
}
}
}
void VideoWidget::setToggleButton( int i, bool down ) {
if ( down != buttons[i].isDown ) {
toggleButton( i );
}
}
-void VideoWidget::paintButton( QPainter &p, int i ) {
-
- Button &button = buttons[ i ];
-
- if ( button.isDown ) {
- p.drawPixmap( upperLeftOfButtonMask, button.pixDown );
- } else {
- p.drawPixmap( upperLeftOfButtonMask, button.pixUp );
- }
-}
-
void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
for ( unsigned int i = 0; i < buttons.count(); i++ ) {
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i );
if ( isOnButton && !buttons[i].isHeld ) {
buttons[i].isHeld = TRUE;
toggleButton(i);
switch (i) {
case VideoVolUp:
@@ -394,32 +383,32 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
if ( mediaPlayerState.isFullscreen() ) {
// Clear the background
p.setBrush( QBrush( Qt::black ) );
} else {
if ( !pe->erased() ) {
// Combine with background and double buffer
QPixmap pix( pe->rect().size() );
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
for ( unsigned int i = 0; i < buttons.count(); i++ ) {
- paintButton( p, i );
+ paintButton( p, buttons[ i ] );
}
QPainter p2( this );
p2.drawPixmap( pe->rect().topLeft(), pix );
} else {
QPainter p( this );
for ( unsigned int i = 0; i < buttons.count(); i++ )
- paintButton( p, i );
+ paintButton( p, buttons[ i ] );
}
//slider->repaint( TRUE );
}
}
void VideoWidget::keyReleaseEvent( QKeyEvent *e) {
switch ( e->key() ) {
////////////////////////////// Zaurus keys
case Key_Home:
break;
case Key_F9: //activity