author | simon <simon> | 2002-12-09 16:45:41 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 16:45:41 (UTC) |
commit | dbe0046eb82c8ee61ce7fc704d3b376730abc17f (patch) (unidiff) | |
tree | d8729a7844dc889024090afe1ffac1c6f3a3ab1b /noncore/multimedia/opieplayer2/audiowidget.cpp | |
parent | 1bb6aa52f2db85f65f75278310c328218caeae65 (diff) | |
download | opie-dbe0046eb82c8ee61ce7fc704d3b376730abc17f.zip opie-dbe0046eb82c8ee61ce7fc704d3b376730abc17f.tar.gz opie-dbe0046eb82c8ee61ce7fc704d3b376730abc17f.tar.bz2 |
- yay, mouseMoveEvent is no more duplicated code :)
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 37c565b..dda039c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -333,51 +333,6 @@ void AudioWidget::timerEvent( QTimerEvent * ) { | |||
333 | } | 333 | } |
334 | } | 334 | } |
335 | 335 | ||
336 | |||
337 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | ||
338 | for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) { | ||
339 | Button &button = *it; | ||
340 | Command command = button.command; | ||
341 | |||
342 | if ( event->state() == QMouseEvent::LeftButton ) { | ||
343 | // The test to see if the mouse click is inside the button or not | ||
344 | bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); | ||
345 | |||
346 | if ( isOnButton && !button.isHeld ) { | ||
347 | button.isHeld = TRUE; | ||
348 | toggleButton( button ); | ||
349 | switch ( command ) { | ||
350 | case VolumeUp: | ||
351 | emit moreClicked(); | ||
352 | return; | ||
353 | case VolumeDown: | ||
354 | emit lessClicked(); | ||
355 | return; | ||
356 | case Forward: | ||
357 | emit forwardClicked(); | ||
358 | return; | ||
359 | case Back: | ||
360 | emit backClicked(); | ||
361 | return; | ||
362 | default: break; | ||
363 | } | ||
364 | } else if ( !isOnButton && button.isHeld ) { | ||
365 | button.isHeld = FALSE; | ||
366 | toggleButton( button ); | ||
367 | } | ||
368 | } else { | ||
369 | if ( button.isHeld ) { | ||
370 | button.isHeld = FALSE; | ||
371 | if ( button.type != ToggleButton ) { | ||
372 | setToggleButton( button, FALSE ); | ||
373 | } | ||
374 | handleCommand( command, button.isDown ); | ||
375 | } | ||
376 | } | ||
377 | } | ||
378 | } | ||
379 | |||
380 | |||
381 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 336 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
382 | mouseMoveEvent( event ); | 337 | mouseMoveEvent( event ); |
383 | } | 338 | } |