author | harlekin <harlekin> | 2002-08-19 21:11:10 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-19 21:11:10 (UTC) |
commit | 0d336f310b310ba18af70185eed58be6e07c26d8 (patch) (unidiff) | |
tree | 4084cce27741e5e3ae1bc309d539b7db2ecc8e99 /noncore/multimedia/opieplayer2/audiowidget.cpp | |
parent | 7f1a7e9b3272f7848423583ea5fc04eb67d97f14 (diff) | |
download | opie-0d336f310b310ba18af70185eed58be6e07c26d8.zip opie-0d336f310b310ba18af70185eed58be6e07c26d8.tar.gz opie-0d336f310b310ba18af70185eed58be6e07c26d8.tar.bz2 |
fixes
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 40e20e1..a718826 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -156,26 +156,26 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
156 | uchar **dest = imgButtonMask->jumpTable(); | 156 | uchar **dest = imgButtonMask->jumpTable(); |
157 | for ( int y = 0; y < imgUp->height(); y++ ) { | 157 | for ( int y = 0; y < imgUp->height(); y++ ) { |
158 | uchar *line = dest[y]; | 158 | uchar *line = dest[y]; |
159 | for ( int x = 0; x < imgUp->width(); x++ ) | 159 | for ( int x = 0; x < imgUp->width(); x++ ) |
160 | if ( !qRed( imgMask.pixel( x, y ) ) ) | 160 | if ( !qRed( imgMask.pixel( x, y ) ) ) |
161 | line[x] = i + 1; | 161 | line[x] = i + 1; |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | } | 165 | } |
166 | 166 | ||
167 | for ( int i = 0; i < 10; i++ ) { | 167 | for ( int i = 0; i < 10; i++ ) { |
168 | buttonPixUp[i] = NULL; | 168 | buttonPixUp[i] = 0l; |
169 | buttonPixDown[i] = NULL; | 169 | buttonPixDown[i] = 0l; |
170 | } | 170 | } |
171 | 171 | ||
172 | setBackgroundPixmap( *pixBg ); | 172 | setBackgroundPixmap( *pixBg ); |
173 | 173 | ||
174 | songInfo.setFocusPolicy( QWidget::NoFocus ); | 174 | songInfo.setFocusPolicy( QWidget::NoFocus ); |
175 | changeTextColor( &songInfo ); | 175 | changeTextColor( &songInfo ); |
176 | 176 | ||
177 | slider.setFixedHeight( 20 ); | 177 | slider.setFixedHeight( 20 ); |
178 | slider.setMinValue( 0 ); | 178 | slider.setMinValue( 0 ); |
179 | slider.setMaxValue( 1 ); | 179 | slider.setMaxValue( 1 ); |
180 | slider.setFocusPolicy( QWidget::NoFocus ); | 180 | slider.setFocusPolicy( QWidget::NoFocus ); |
181 | slider.setBackgroundPixmap( *pixBg ); | 181 | slider.setBackgroundPixmap( *pixBg ); |
@@ -218,40 +218,42 @@ AudioWidget::~AudioWidget() { | |||
218 | delete buttonPixUp[i]; | 218 | delete buttonPixUp[i]; |
219 | delete buttonPixDown[i]; | 219 | delete buttonPixDown[i]; |
220 | } | 220 | } |
221 | delete pixBg; | 221 | delete pixBg; |
222 | delete imgUp; | 222 | delete imgUp; |
223 | delete imgDn; | 223 | delete imgDn; |
224 | delete imgButtonMask; | 224 | delete imgButtonMask; |
225 | for ( int i = 0; i < 10; i++ ) { | 225 | for ( int i = 0; i < 10; i++ ) { |
226 | delete masks[i]; | 226 | delete masks[i]; |
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | namespace { | ||
231 | |||
230 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 232 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
231 | QPixmap pix( img.width(), img.height() ); | 233 | QPixmap pix( img.width(), img.height() ); |
232 | QPainter p( &pix ); | 234 | QPainter p( &pix ); |
233 | p.drawTiledPixmap( pix.rect(), bg, offset ); | 235 | p.drawTiledPixmap( pix.rect(), bg, offset ); |
234 | p.drawImage( 0, 0, img ); | 236 | p.drawImage( 0, 0, img ); |
235 | return new QPixmap( pix ); | 237 | return new QPixmap( pix ); |
236 | } | 238 | } |
237 | 239 | ||
238 | 240 | ||
239 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { | 241 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { |
240 | QPixmap *pixmap = new QPixmap( pix ); | 242 | QPixmap *pixmap = new QPixmap( pix ); |
241 | pixmap->setMask( mask ); | 243 | pixmap->setMask( mask ); |
242 | return pixmap; | 244 | return pixmap; |
243 | } | 245 | } |
244 | 246 | ||
245 | 247 | }; | |
246 | 248 | ||
247 | void AudioWidget::resizeEvent( QResizeEvent * ) { | 249 | void AudioWidget::resizeEvent( QResizeEvent * ) { |
248 | int h = height(); | 250 | int h = height(); |
249 | int w = width(); | 251 | int w = width(); |
250 | 252 | ||
251 | songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); | 253 | songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); |
252 | slider.setFixedWidth( w - 110 ); | 254 | slider.setFixedWidth( w - 110 ); |
253 | slider.setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); | 255 | slider.setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); |
254 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); | 256 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); |
255 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); | 257 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); |
256 | 258 | ||
257 | xoff = ( w - imgUp->width() ) / 2; | 259 | xoff = ( w - imgUp->width() ) / 2; |