Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 271f788..9c5291b 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -94,13 +94,13 @@ bool MediaWidget::isOverButton( const QPoint &position, int buttonId ) const | |||
94 | } | 94 | } |
95 | 95 | ||
96 | void MediaWidget::paintAllButtons( QPainter &p ) | 96 | void MediaWidget::paintAllButtons( QPainter &p ) |
97 | { | 97 | { |
98 | for ( ButtonMap::ConstIterator it = buttons.begin(); | 98 | for ( ButtonMap::ConstIterator it = buttons.begin(); |
99 | it != buttons.end(); ++it ) | 99 | it != buttons.end(); ++it ) |
100 | paintButton( *it ); | 100 | paintButton( p, *it ); |
101 | } | 101 | } |
102 | 102 | ||
103 | void MediaWidget::paintButton( const Button &button ) | 103 | void MediaWidget::paintButton( const Button &button ) |
104 | { | 104 | { |
105 | QPainter p( this ); | 105 | QPainter p( this ); |
106 | paintButton( p, button ); | 106 | paintButton( p, button ); |
@@ -111,12 +111,22 @@ void MediaWidget::paintButton( QPainter &p, const Button &button ) | |||
111 | if ( button.isDown ) | 111 | if ( button.isDown ) |
112 | p.drawPixmap( upperLeftOfButtonMask, button.pixDown ); | 112 | p.drawPixmap( upperLeftOfButtonMask, button.pixDown ); |
113 | else | 113 | else |
114 | p.drawPixmap( upperLeftOfButtonMask, button.pixUp ); | 114 | p.drawPixmap( upperLeftOfButtonMask, button.pixUp ); |
115 | } | 115 | } |
116 | 116 | ||
117 | void MediaWidget::setToggleButton( int buttonId, bool down ) | ||
118 | { | ||
119 | qDebug("setToggleButton %d", buttonId ); | ||
120 | |||
121 | Button &button = buttons[ buttonId ]; | ||
122 | |||
123 | if ( down != button.isDown ) | ||
124 | toggleButton( buttonId ); | ||
125 | } | ||
126 | |||
117 | void MediaWidget::toggleButton( int buttonId ) | 127 | void MediaWidget::toggleButton( int buttonId ) |
118 | { | 128 | { |
119 | Button &button = buttons[ buttonId ]; | 129 | Button &button = buttons[ buttonId ]; |
120 | 130 | ||
121 | button.isDown = !button.isDown; | 131 | button.isDown = !button.isDown; |
122 | 132 | ||