author | simon <simon> | 2002-12-08 22:47:39 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-08 22:47:39 (UTC) |
commit | 786bc677f61983414df8a4613cc525c4bcd2a054 (patch) (side-by-side diff) | |
tree | c39a2a1691ffc8d813a496cb47c00b8ede47ea30 /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | 8b72df0bb25ca5a0791756b2444fc6a1ce361082 (diff) | |
download | opie-786bc677f61983414df8a4613cc525c4bcd2a054.zip opie-786bc677f61983414df8a4613cc525c4bcd2a054.tar.gz opie-786bc677f61983414df8a4613cc525c4bcd2a054.tar.bz2 |
- moved the duplicated code for checking whether the mouse is over a
button into a shared isOverButton method
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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 @@ -282,12 +282,7 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { for ( unsigned int i = 0; i < buttons.size(); i++ ) { if ( event->state() == QMouseEvent::LeftButton ) { // The test to see if the mouse click is inside the button or not - int x = event->pos().x() - upperLeftOfButtonMask.x(); - int y = event->pos().y() - upperLeftOfButtonMask.y(); - - bool isOnButton = ( x > 0 && y > 0 && x < buttonMask.width() - && y < buttonMask.height() - && buttonMask.pixelIndex( x, y ) == i + 1 ); + bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); if ( isOnButton && !buttons[i].isHeld ) { buttons[i].isHeld = TRUE; |