From 786bc677f61983414df8a4613cc525c4bcd2a054 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 08 Dec 2002 22:47:39 +0000 Subject: - moved the duplicated code for checking whether the mouse is over a button into a shared isOverButton method --- (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') 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; -- cgit v0.9.0.2