author | sandman <sandman> | 2002-11-28 00:37:59 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-28 00:37:59 (UTC) |
commit | 0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a (patch) (unidiff) | |
tree | f4a225c3236b2608c1127e62750c4106e35bfd66 /noncore/styles/theme/ogfxeffect.cpp | |
parent | 57ad30fb514428e068142e31ee40aa1615291123 (diff) | |
download | opie-0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a.zip opie-0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a.tar.gz opie-0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a.tar.bz2 |
Some checks for null pixmaps (qtmail seems to create a scrollbar with
width and height == -1 when you tap "New mailbox")
Diffstat (limited to 'noncore/styles/theme/ogfxeffect.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/styles/theme/ogfxeffect.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/styles/theme/ogfxeffect.cpp b/noncore/styles/theme/ogfxeffect.cpp index 2071a67..90b45fe 100644 --- a/noncore/styles/theme/ogfxeffect.cpp +++ b/noncore/styles/theme/ogfxeffect.cpp | |||
@@ -24,15 +24,16 @@ | |||
24 | //====================================================================== | 24 | //====================================================================== |
25 | 25 | ||
26 | 26 | ||
27 | QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca, | 27 | QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca, |
28 | const QColor &cb, GradientType eff, int ncols) | 28 | const QColor &cb, GradientType eff, int ncols) |
29 | { | 29 | { |
30 | if ( !pixmap. isNull ( )) { | ||
30 | QImage image = gradient(pixmap.size(), ca, cb, eff, ncols); | 31 | QImage image = gradient(pixmap.size(), ca, cb, eff, ncols); |
31 | pixmap.convertFromImage(image); | 32 | pixmap.convertFromImage(image); |
32 | 33 | } | |
33 | return pixmap; | 34 | return pixmap; |
34 | } | 35 | } |
35 | 36 | ||
36 | QImage OGfxEffect::gradient(const QSize &size, const QColor &ca, | 37 | QImage OGfxEffect::gradient(const QSize &size, const QColor &ca, |
37 | const QColor &cb, GradientType eff, int /*ncols*/) | 38 | const QColor &cb, GradientType eff, int /*ncols*/) |
38 | { | 39 | { |
@@ -277,20 +278,21 @@ QImage OGfxEffect::gradient(const QSize &size, const QColor &ca, | |||
277 | 278 | ||
278 | 279 | ||
279 | QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity, | 280 | QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity, |
280 | const QColor &bgnd, GradientType eff, | 281 | const QColor &bgnd, GradientType eff, |
281 | bool anti_dir, int /*ncols*/) | 282 | bool anti_dir, int /*ncols*/) |
282 | { | 283 | { |
284 | if ( !pixmap. isNull ( )) { | ||
283 | QImage image = pixmap.convertToImage(); | 285 | QImage image = pixmap.convertToImage(); |
284 | OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir); | 286 | OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir); |
285 | 287 | ||
286 | if ( pixmap. depth ( ) <= 8 ) | 288 | if ( pixmap. depth ( ) <= 8 ) |
287 | image. convertDepth ( pixmap. depth ( )); | 289 | image. convertDepth ( pixmap. depth ( )); |
288 | 290 | ||
289 | pixmap.convertFromImage(image); | 291 | pixmap.convertFromImage(image); |
290 | 292 | } | |
291 | return pixmap; | 293 | return pixmap; |
292 | } | 294 | } |
293 | 295 | ||
294 | 296 | ||
295 | QImage& OGfxEffect::blend(QImage &image, float initial_intensity, | 297 | QImage& OGfxEffect::blend(QImage &image, float initial_intensity, |
296 | const QColor &bgnd, GradientType eff, | 298 | const QColor &bgnd, GradientType eff, |