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/mediawidget.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/mediawidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ -57,8 +57,16 @@ void MediaWidget::handleCommand( Command command, bool buttonDown ) case PlayList: mediaPlayerState.setList(); return; case Forward: emit forwardReleased(); return; case Back: emit backReleased(); return; } } +bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const +{ + return ( position.x() > 0 && position.y() > 0 && + position.x() < buttonMask.width() && + position.y() < buttonMask.height() && + buttonMask.pixelIndex( position.x(), position.y() ) == buttonId + 1 ); +} + /* vim: et sw=4 ts=4 */ |