author | sandman <sandman> | 2002-11-28 00:37:59 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-28 00:37:59 (UTC) |
commit | 0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a (patch) (side-by-side diff) | |
tree | f4a225c3236b2608c1127e62750c4106e35bfd66 /noncore | |
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")
-rw-r--r-- | noncore/styles/theme/ogfxeffect.cpp | 22 | ||||
-rw-r--r-- | noncore/styles/theme/othemestyle.cpp | 6 |
2 files changed, 17 insertions, 11 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 @@ -29,5 +29,6 @@ QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca, { - QImage image = gradient(pixmap.size(), ca, cb, eff, ncols); - pixmap.convertFromImage(image); - + if ( !pixmap. isNull ( )) { + QImage image = gradient(pixmap.size(), ca, cb, eff, ncols); + pixmap.convertFromImage(image); + } return pixmap; @@ -282,11 +283,12 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity, { - QImage image = pixmap.convertToImage(); - OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir); - - if ( pixmap. depth ( ) <= 8 ) - image. convertDepth ( pixmap. depth ( )); + if ( !pixmap. isNull ( )) { + QImage image = pixmap.convertToImage(); + OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir); - pixmap.convertFromImage(image); + if ( pixmap. depth ( ) <= 8 ) + image. convertDepth ( pixmap. depth ( )); - return pixmap; + pixmap.convertFromImage(image); + } + return pixmap; } diff --git a/noncore/styles/theme/othemestyle.cpp b/noncore/styles/theme/othemestyle.cpp index a820efb..98e7253 100644 --- a/noncore/styles/theme/othemestyle.cpp +++ b/noncore/styles/theme/othemestyle.cpp @@ -251,2 +251,5 @@ void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, { + if ( w <= 0 || h <= 0 ) + return; + int offset = borderPixmap( type ) ? 0 : decoWidth( type ); @@ -289,5 +292,6 @@ void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, } - if ( borderPixmap( type ) ) + if ( borderPixmap( type ) ) { bitBlt( p->device(), x, y, scaleBorder( w, h, type ), 0, 0, w, h, Qt::CopyROP, false ); + } else |