summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show 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
@@ -77,8 +77,6 @@ AudioWidget::AudioWidget( 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;
@@ -391,3 +389,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
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
@@ -37,2 +37,3 @@ public:
enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back };
+ enum ButtonType { NormalButton, ToggleButton };
@@ -40,5 +41,5 @@ public:
{
- Button() : isToggle( false ), isHeld( false ), isDown( false ) {}
+ Button() : buttonType( NormalButton ), isHeld( false ), isDown( false ) {}
- bool isToggle : 1;
+ ButtonType buttonType : 1;
bool isHeld : 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
@@ -73,6 +73,4 @@ 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;
@@ -300,3 +298,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
buttons[i].isHeld = FALSE;
- if ( !buttons[i].isToggle ) {
+ if ( buttons[i].buttonType != ToggleButton ) {
setToggleButton( i, FALSE );