author | simon <simon> | 2002-12-09 18:33:53 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 18:33:53 (UTC) |
commit | 711d8c1af3ebdd6f88ff3e9ffa46624c9b63badd (patch) (side-by-side diff) | |
tree | 20ad8855c3e9fcb0e0ec5a79b3d9e934236e1344 | |
parent | 29b5784bba7b19497b5984418bacee261075ccf7 (diff) | |
download | opie-711d8c1af3ebdd6f88ff3e9ffa46624c9b63badd.zip opie-711d8c1af3ebdd6f88ff3e9ffa46624c9b63badd.tar.gz opie-711d8c1af3ebdd6f88ff3e9ffa46624c9b63badd.tar.bz2 |
- another small cleanup in the mouse handling
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 |
6 files changed, 13 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index dda039c..5986a72 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -320,42 +320,32 @@ void AudioWidget::skipBack() { void AudioWidget::stopSkip() { killTimers(); } void AudioWidget::timerEvent( QTimerEvent * ) { if ( skipDirection == +1 ) { mediaPlayerState.setPosition( mediaPlayerState.position() + 2 ); } else if ( skipDirection == -1 ) { mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); } } -void AudioWidget::mousePressEvent( QMouseEvent *event ) { - mouseMoveEvent( event ); -} - - -void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { - mouseMoveEvent( event ); -} - - void AudioWidget::showEvent( QShowEvent* ) { QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); mouseMoveEvent( &event ); } void AudioWidget::keyReleaseEvent( QKeyEvent *e) { switch ( e->key() ) { ////////////////////////////// Zaurus keys case Key_Home: break; case Key_F9: //activity hide(); // qDebug("Audio F9"); break; case Key_F10: //contacts break; diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 690d1b3..e2e2314 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -63,34 +63,32 @@ public slots: void setPosition( long ); void setSeekable( bool ); public: virtual void setLength( long ); virtual void setPlaying( bool b) { setToggleButton( Play, b ); } virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); signals: void sliderMoved(long); protected: void doBlank(); void doUnblank(); void showEvent( QShowEvent *se ); void resizeEvent( QResizeEvent *re ); - void mousePressEvent( QMouseEvent *event ); - void mouseReleaseEvent( QMouseEvent *event ); void timerEvent( QTimerEvent *event ); void keyReleaseEvent( QKeyEvent *e); private slots: void skipFor(); void skipBack(); void stopSkip(); private: int skipDirection; QString skin; QImage imgUp; QImage imgDn; OTicker songInfo; QSlider slider; QLineEdit time; bool isStreaming : 1; diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 3533d74..439ba2e 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -100,32 +100,42 @@ void MediaWidget::mouseMoveEvent( QMouseEvent *event ) } else if ( !isOnButton && button.isHeld ) { button.isHeld = FALSE; toggleButton( button ); } } else { if ( button.isHeld ) { button.isHeld = FALSE; if ( button.type != ToggleButton ) { setToggleButton( button, FALSE ); } handleCommand( command, button.isDown ); } } } } +void MediaWidget::mousePressEvent( QMouseEvent *event ) +{ + mouseMoveEvent( event ); +} + +void MediaWidget::mouseReleaseEvent( QMouseEvent *event ) +{ + mouseMoveEvent( event ); +} + void MediaWidget::makeVisible() { } void MediaWidget::handleCommand( Command command, bool buttonDown ) { switch ( command ) { case Play: mediaPlayerState.togglePaused(); case Stop: mediaPlayerState.setPlaying(FALSE); return; case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; case Loop: mediaPlayerState.setLooping( buttonDown ); return; case VolumeUp: emit moreReleased(); return; case VolumeDown: emit lessReleased(); return; case PlayList: mediaPlayerState.setList(); return; case Forward: emit forwardReleased(); return; diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index c261728..9042d5b 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -75,32 +75,34 @@ public slots: signals: void moreReleased(); void lessReleased(); void forwardReleased(); void backReleased(); void forwardClicked(); void backClicked(); void moreClicked(); void lessClicked(); protected: virtual void closeEvent( QCloseEvent * ); virtual void paintEvent( QPaintEvent *pe ); virtual void mouseMoveEvent( QMouseEvent *event ); + virtual void mousePressEvent( QMouseEvent *event ); + virtual void mouseReleaseEvent( QMouseEvent *event ); virtual void makeVisible(); void handleCommand( Command command, bool buttonDown ); bool isOverButton( const QPoint &position, int buttonId ) const; void paintAllButtons( QPainter &p ); void paintButton( const Button &button ); void paintButton( QPainter &p, const Button &button ); void setToggleButton( Button &button, bool down ); void setToggleButton( Command command, bool down ); void toggleButton( Button &button ); MediaPlayerState &mediaPlayerState; diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 26777e6..04b09f9 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -228,42 +228,38 @@ void VideoWidget::updateSlider( long i, long max ) { // Will flicker too much if we don't do this if ( max == 0 ) { return; } int width = slider->width(); int val = int((double)i * width / max); if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { if ( slider->value() != val ) { slider->setValue( val ); } if ( slider->maxValue() != width ) { slider->setMaxValue( width ); } } } -void VideoWidget::mousePressEvent( QMouseEvent *event ) { - mouseMoveEvent( event ); -} - void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { if ( mediaPlayerState.isFullscreen() ) { mediaPlayerState.setFullscreen( FALSE ); makeVisible(); } - mouseMoveEvent( event ); + MediaWidget::mouseReleaseEvent( event ); } void VideoWidget::showEvent( QShowEvent* ) { QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); mouseMoveEvent( &event ); } void VideoWidget::backToNormal() { mediaPlayerState.setFullscreen( FALSE ); makeVisible(); } void VideoWidget::makeVisible() { if ( mediaPlayerState.isFullscreen() ) { setBackgroundMode( QWidget::NoBackground ); diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index bed2116..985c094 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -63,33 +63,32 @@ public slots: public: virtual void setPlaying( bool b); virtual void setLength( long ); virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); signals: void moreClicked(); void lessClicked(); void sliderMoved( long ); void videoResized ( const QSize &s ); protected: void resizeEvent( QResizeEvent * ); void showEvent( QShowEvent *se ); - void mousePressEvent( QMouseEvent *event ); void mouseReleaseEvent( QMouseEvent *event ); void keyReleaseEvent( QKeyEvent *e); private: // Ticker songInfo; QImage imgUp; QImage imgDn; QString skin; QString backgroundPix; QSlider *slider; QImage *currentFrame; int scaledWidth; int scaledHeight; |