author | simon <simon> | 2002-12-09 13:52:00 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 13:52:00 (UTC) |
commit | 46bca195f0dacc3b596eb1537ae47bc2117ce8e4 (patch) (side-by-side diff) | |
tree | 135414127395da9466d77ef71fa85bd41b130bf0 | |
parent | 374d7ba11f669449900c7e93f7929d724eb85f26 (diff) | |
download | opie-46bca195f0dacc3b596eb1537ae47bc2117ce8e4.zip opie-46bca195f0dacc3b596eb1537ae47bc2117ce8e4.tar.gz opie-46bca195f0dacc3b596eb1537ae47bc2117ce8e4.tar.bz2 |
- isToggle is now an enum ButtonType { NormalButton, ToggleButton };
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 8 |
3 files changed, 10 insertions, 13 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 @@ -75,12 +75,10 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), audioSliderBeingMoved( false ) { - Button defaultButton; - defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; - Button toggleButton; - toggleButton.isToggle = true; - toggleButton.isHeld = toggleButton.isDown = false; + + Button toggleButton = defaultButton; + toggleButton.buttonType = ToggleButton; buttons.reserve( 10 ); buttons.push_back( toggleButton ); // play @@ -389,7 +387,7 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { } else { if ( buttons[i].isHeld ) { buttons[i].isHeld = FALSE; - if ( !buttons[i].isToggle ) { + if ( buttons[i].buttonType != ToggleButton ) { setToggleButton( i, FALSE ); } qDebug("mouseEvent %d", i); diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 46c304d..aa8891f 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -35,12 +35,13 @@ class MediaWidget : public QWidget Q_OBJECT public: enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; + enum ButtonType { NormalButton, ToggleButton }; struct Button { - Button() : isToggle( false ), isHeld( false ), isDown( false ) {} + Button() : buttonType( NormalButton ), isHeld( false ), isDown( false ) {} - bool isToggle : 1; + ButtonType buttonType : 1; bool isHeld : 1; bool isDown : 1; }; diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 2f51c82..23acfa3 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -71,10 +71,8 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye setCaption( tr("OpiePlayer - Video") ); Button defaultButton; - defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; - Button toggleButton; - toggleButton.isToggle = true; - toggleButton.isHeld = toggleButton.isDown = false; + Button toggleButton = defaultButton; + toggleButton.buttonType = ToggleButton; buttons.reserve( 7 ); buttons.push_back( toggleButton ); // play @@ -298,7 +296,7 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { if ( buttons[i].isHeld ) { buttons[i].isHeld = FALSE; - if ( !buttons[i].isToggle ) { + if ( buttons[i].buttonType != ToggleButton ) { setToggleButton( i, FALSE ); } |