summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-09 16:33:52 (UTC)
committer simon <simon>2002-12-09 16:33:52 (UTC)
commit1ae041fba55e218a2523de441bec6ec3a1eecf02 (patch) (side-by-side diff)
treee12caa0db284f3237f52c91bbcd9578c5dcce8a7
parent8eb71085cec5e24e20b441ceae9e5e66448405b3 (diff)
downloadopie-1ae041fba55e218a2523de441bec6ec3a1eecf02.zip
opie-1ae041fba55e218a2523de441bec6ec3a1eecf02.tar.gz
opie-1ae041fba55e218a2523de441bec6ec3a1eecf02.tar.bz2
- more cleanups in the mouse event handler
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp5
2 files changed, 4 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 3838e2c..37c565b 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -326,27 +326,26 @@ void AudioWidget::stopSkip() {
void AudioWidget::timerEvent( QTimerEvent * ) {
if ( skipDirection == +1 ) {
mediaPlayerState.setPosition( mediaPlayerState.position() + 2 );
} else if ( skipDirection == -1 ) {
mediaPlayerState.setPosition( mediaPlayerState.position() - 2 );
}
}
void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
- for ( unsigned int i = 0; i < buttons.size(); i++ ) {
-
- Button &button = buttons[ i ];
+ for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) {
+ Button &button = *it;
Command command = button.command;
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command );
if ( isOnButton && !button.isHeld ) {
button.isHeld = TRUE;
toggleButton( button );
switch ( command ) {
case VolumeUp:
emit moreClicked();
@@ -363,25 +362,24 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
default: break;
}
} else if ( !isOnButton && button.isHeld ) {
button.isHeld = FALSE;
toggleButton( button );
}
} else {
if ( button.isHeld ) {
button.isHeld = FALSE;
if ( button.type != ToggleButton ) {
setToggleButton( button, FALSE );
}
- qDebug("mouseEvent %d", i);
handleCommand( command, button.isDown );
}
}
}
}
void AudioWidget::mousePressEvent( QMouseEvent *event ) {
mouseMoveEvent( event );
}
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 06f6cd2..12316f8 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -235,27 +235,26 @@ void VideoWidget::updateSlider( long i, long max ) {
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::mouseMoveEvent( QMouseEvent *event ) {
- for ( unsigned int i = 0; i < buttons.size(); i++ ) {
-
- Button &button = buttons[ i ];
+ for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) {
+ Button &button = *it;
Command command = button.command;
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command );
if ( isOnButton && !button.isHeld ) {
button.isHeld = TRUE;
toggleButton( button );
switch ( command ) {
case VolumeUp: