summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp7
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp8
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp7
4 files changed, 12 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 4301a67..d083273 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -382,10 +382,5 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
382 if ( event->state() == QMouseEvent::LeftButton ) { 382 if ( event->state() == QMouseEvent::LeftButton ) {
383 // The test to see if the mouse click is inside the button or not 383 // The test to see if the mouse click is inside the button or not
384 int x = event->pos().x() - upperLeftOfButtonMask.x(); 384 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i );
385 int y = event->pos().y() - upperLeftOfButtonMask.y();
386
387 bool isOnButton = ( x > 0 && y > 0 && x < buttonMask.width()
388 && y < buttonMask.height()
389 && buttonMask.pixelIndex( x, y ) == i + 1 );
390 385
391 if ( isOnButton && !buttons[i].isHeld ) { 386 if ( isOnButton && !buttons[i].isHeld ) {
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index a1b292e..1d18d6f 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -61,4 +61,12 @@ void MediaWidget::handleCommand( Command command, bool buttonDown )
61} 61}
62 62
63bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const
64{
65 return ( position.x() > 0 && position.y() > 0 &&
66 position.x() < buttonMask.width() &&
67 position.y() < buttonMask.height() &&
68 buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 );
69}
70
63/* vim: et sw=4 ts=4 71/* vim: et sw=4 ts=4
64 */ 72 */
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 7e6cb3b..6e12a3b 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -66,4 +66,6 @@ protected:
66 void handleCommand( Command command, bool buttonDown ); 66 void handleCommand( Command command, bool buttonDown );
67 67
68 bool isOverButton( const QPoint &position, int buttonId ) const;
69
68 MediaPlayerState &mediaPlayerState; 70 MediaPlayerState &mediaPlayerState;
69 PlayListWidget &playList; 71 PlayListWidget &playList;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 6ab6d7b..6451ac4 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -283,10 +283,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
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() - upperLeftOfButtonMask.x(); 285 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i );
286 int y = event->pos().y() - upperLeftOfButtonMask.y();
287
288 bool isOnButton = ( x > 0 && y > 0 && x < buttonMask.width()
289 && y < buttonMask.height()
290 && buttonMask.pixelIndex( x, y ) == i + 1 );
291 286
292 if ( isOnButton && !buttons[i].isHeld ) { 287 if ( isOnButton && !buttons[i].isHeld ) {