Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 9c5291b..66129c9 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -105,33 +105,27 @@ void MediaWidget::paintButton( const Button &button ) | |||
105 | QPainter p( this ); | 105 | QPainter p( this ); |
106 | paintButton( p, button ); | 106 | paintButton( p, button ); |
107 | } | 107 | } |
108 | 108 | ||
109 | void MediaWidget::paintButton( QPainter &p, const Button &button ) | 109 | void MediaWidget::paintButton( QPainter &p, const Button &button ) |
110 | { | 110 | { |
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 ) | 117 | void MediaWidget::setToggleButton( Button &button, bool down ) |
118 | { | 118 | { |
119 | qDebug("setToggleButton %d", buttonId ); | ||
120 | |||
121 | Button &button = buttons[ buttonId ]; | ||
122 | |||
123 | if ( down != button.isDown ) | 119 | if ( down != button.isDown ) |
124 | toggleButton( buttonId ); | 120 | toggleButton( button ); |
125 | } | 121 | } |
126 | 122 | ||
127 | void MediaWidget::toggleButton( int buttonId ) | 123 | void MediaWidget::toggleButton( Button &button ) |
128 | { | 124 | { |
129 | Button &button = buttons[ buttonId ]; | ||
130 | |||
131 | button.isDown = !button.isDown; | 125 | button.isDown = !button.isDown; |
132 | 126 | ||
133 | paintButton( button ); | 127 | paintButton( button ); |
134 | } | 128 | } |
135 | 129 | ||
136 | /* vim: et sw=4 ts=4 | 130 | /* vim: et sw=4 ts=4 |
137 | */ | 131 | */ |