Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 8659971..56b75f2 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -66,30 +66,28 @@ void changeTextColor( QWidget * w) { | |||
66 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); | 66 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); |
67 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); | 67 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); |
68 | w->setPalette( p ); | 68 | w->setPalette( p ); |
69 | } | 69 | } |
70 | 70 | ||
71 | } | 71 | } |
72 | 72 | ||
73 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : | 73 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : |
74 | 74 | ||
75 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), | 75 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), |
76 | audioSliderBeingMoved( false ) | 76 | audioSliderBeingMoved( false ) |
77 | { | 77 | { |
78 | |||
79 | Button defaultButton; | 78 | Button defaultButton; |
80 | defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; | 79 | |
81 | Button toggleButton; | 80 | Button toggleButton = defaultButton; |
82 | toggleButton.isToggle = true; | 81 | toggleButton.buttonType = ToggleButton; |
83 | toggleButton.isHeld = toggleButton.isDown = false; | ||
84 | 82 | ||
85 | buttons.reserve( 10 ); | 83 | buttons.reserve( 10 ); |
86 | buttons.push_back( toggleButton ); // play | 84 | buttons.push_back( toggleButton ); // play |
87 | buttons.push_back( defaultButton ); // stop | 85 | buttons.push_back( defaultButton ); // stop |
88 | buttons.push_back( defaultButton ); // next | 86 | buttons.push_back( defaultButton ); // next |
89 | buttons.push_back( defaultButton ); // previous | 87 | buttons.push_back( defaultButton ); // previous |
90 | buttons.push_back( defaultButton ); // volume up | 88 | buttons.push_back( defaultButton ); // volume up |
91 | buttons.push_back( defaultButton ); // volume down | 89 | buttons.push_back( defaultButton ); // volume down |
92 | buttons.push_back( toggleButton ); // repeat/loop | 90 | buttons.push_back( toggleButton ); // repeat/loop |
93 | buttons.push_back( defaultButton ); // playlist | 91 | buttons.push_back( defaultButton ); // playlist |
94 | buttons.push_back( defaultButton ); // forward | 92 | buttons.push_back( defaultButton ); // forward |
95 | buttons.push_back( defaultButton ); // back | 93 | buttons.push_back( defaultButton ); // back |
@@ -380,25 +378,25 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
380 | return; | 378 | return; |
381 | case Back: | 379 | case Back: |
382 | emit backClicked(); | 380 | emit backClicked(); |
383 | return; | 381 | return; |
384 | } | 382 | } |
385 | } else if ( !isOnButton && buttons[i].isHeld ) { | 383 | } else if ( !isOnButton && buttons[i].isHeld ) { |
386 | buttons[i].isHeld = FALSE; | 384 | buttons[i].isHeld = FALSE; |
387 | toggleButton(i); | 385 | toggleButton(i); |
388 | } | 386 | } |
389 | } else { | 387 | } else { |
390 | if ( buttons[i].isHeld ) { | 388 | if ( buttons[i].isHeld ) { |
391 | buttons[i].isHeld = FALSE; | 389 | buttons[i].isHeld = FALSE; |
392 | if ( !buttons[i].isToggle ) { | 390 | if ( buttons[i].buttonType != ToggleButton ) { |
393 | setToggleButton( i, FALSE ); | 391 | setToggleButton( i, FALSE ); |
394 | } | 392 | } |
395 | qDebug("mouseEvent %d", i); | 393 | qDebug("mouseEvent %d", i); |
396 | handleCommand( static_cast<Command>( i ), buttons[ i ].isDown ); | 394 | handleCommand( static_cast<Command>( i ), buttons[ i ].isDown ); |
397 | } | 395 | } |
398 | } | 396 | } |
399 | } | 397 | } |
400 | } | 398 | } |
401 | 399 | ||
402 | 400 | ||
403 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 401 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
404 | mouseMoveEvent( event ); | 402 | mouseMoveEvent( event ); |