summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/videowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 459f592..6ab6d7b 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -177,18 +177,18 @@ void VideoWidget::resizeEvent( QResizeEvent * ) {
177 slider->setFixedWidth( w - 20 ); 177 slider->setFixedWidth( w - 20 );
178 slider->setGeometry( QRect( 15, h - 22, w - 90, 20 ) ); 178 slider->setGeometry( QRect( 15, h - 22, w - 90, 20 ) );
179 slider->setBackgroundOrigin( QWidget::ParentOrigin ); 179 slider->setBackgroundOrigin( QWidget::ParentOrigin );
180 slider->setFocusPolicy( QWidget::NoFocus ); 180 slider->setFocusPolicy( QWidget::NoFocus );
181 slider->setBackgroundPixmap( pixBg ); 181 slider->setBackgroundPixmap( pixBg );
182 182
183 xoff = 0;// ( imgUp->width() ) / 2; 183 upperLeftOfButtonMask.rx() = 0;// ( imgUp->width() ) / 2;
184 if(w>h) 184 if(w>h)
185 yoff = 0; 185 upperLeftOfButtonMask.ry() = 0;
186 else 186 else
187 yoff = 185;//(( Vh - imgUp->height() ) / 2) - 10; 187 upperLeftOfButtonMask.ry() = 185;//(( Vh - imgUp->height() ) / 2) - 10;
188 QPoint p( xoff, yoff ); 188 QPoint p = upperLeftOfButtonMask;
189 189
190 QPixmap *pixUp = combineVImageWithBackground( imgUp, pixBg, p ); 190 QPixmap *pixUp = combineVImageWithBackground( imgUp, pixBg, p );
191 QPixmap *pixDn = combineVImageWithBackground( imgDn, pixBg, p ); 191 QPixmap *pixDn = combineVImageWithBackground( imgDn, pixBg, p );
192 192
193 for ( int i = 0; i < 7; i++ ) { 193 for ( int i = 0; i < 7; i++ ) {
194 if ( !masks[i]->isNull() ) { 194 if ( !masks[i]->isNull() ) {
@@ -269,24 +269,24 @@ void VideoWidget::toggleButton( int i ) {
269 paintButton ( &p, i ); 269 paintButton ( &p, i );
270} 270}
271 271
272void VideoWidget::paintButton( QPainter *p, int i ) { 272void VideoWidget::paintButton( QPainter *p, int i ) {
273 273
274 if ( buttons[i].isDown ) { 274 if ( buttons[i].isDown ) {
275 p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); 275 p->drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] );
276 } else { 276 } else {
277 p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); 277 p->drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] );
278 } 278 }
279} 279}
280 280
281void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { 281void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
282 for ( unsigned int i = 0; i < buttons.size(); i++ ) { 282 for ( unsigned int i = 0; i < buttons.size(); i++ ) {
283 if ( event->state() == QMouseEvent::LeftButton ) { 283 if ( event->state() == QMouseEvent::LeftButton ) {
284 // The test to see if the mouse click is inside the button or not 284 // The test to see if the mouse click is inside the button or not
285 int x = event->pos().x() - xoff; 285 int x = event->pos().x() - upperLeftOfButtonMask.x();
286 int y = event->pos().y() - yoff; 286 int y = event->pos().y() - upperLeftOfButtonMask.y();
287 287
288 bool isOnButton = ( x > 0 && y > 0 && x < buttonMask.width() 288 bool isOnButton = ( x > 0 && y > 0 && x < buttonMask.width()
289 && y < buttonMask.height() 289 && y < buttonMask.height()
290 && buttonMask.pixelIndex( x, y ) == i + 1 ); 290 && buttonMask.pixelIndex( x, y ) == i + 1 );
291 291
292 if ( isOnButton && !buttons[i].isHeld ) { 292 if ( isOnButton && !buttons[i].isHeld ) {