summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp10
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h5
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp8
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
@@ -76,10 +76,8 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
audioSliderBeingMoved( false )
{
+ Button defaultButton;
- 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 );
@@ -390,5 +388,5 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
if ( buttons[i].isHeld ) {
buttons[i].isHeld = FALSE;
- if ( !buttons[i].isToggle ) {
+ if ( buttons[i].buttonType != ToggleButton ) {
setToggleButton( i, FALSE );
}
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
@@ -36,10 +36,11 @@ class MediaWidget : public QWidget
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
@@ -72,8 +72,6 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
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 );
@@ -299,5 +297,5 @@ 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 );
}