-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 | |||
@@ -28,7 +28,8 @@ 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 | QImage image = gradient(pixmap.size(), ca, cb, eff, ncols); | 30 | if ( !pixmap. isNull ( )) { |
31 | pixmap.convertFromImage(image); | 31 | QImage image = gradient(pixmap.size(), ca, cb, eff, ncols); |
32 | 32 | pixmap.convertFromImage(image); | |
33 | } | ||
33 | return pixmap; | 34 | return pixmap; |
34 | } | 35 | } |
@@ -281,13 +282,14 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity, | |||
281 | bool anti_dir, int /*ncols*/) | 282 | bool anti_dir, int /*ncols*/) |
282 | { | 283 | { |
283 | QImage image = pixmap.convertToImage(); | 284 | if ( !pixmap. isNull ( )) { |
284 | OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir); | 285 | QImage image = pixmap.convertToImage(); |
285 | 286 | OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir); | |
286 | if ( pixmap. depth ( ) <= 8 ) | ||
287 | image. convertDepth ( pixmap. depth ( )); | ||
288 | 287 | ||
289 | pixmap.convertFromImage(image); | 288 | if ( pixmap. depth ( ) <= 8 ) |
289 | image. convertDepth ( pixmap. depth ( )); | ||
290 | 290 | ||
291 | return pixmap; | 291 | pixmap.convertFromImage(image); |
292 | } | ||
293 | return pixmap; | ||
292 | } | 294 | } |
293 | 295 | ||
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 | |||
@@ -250,4 +250,7 @@ void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, | |||
250 | rounded, WidgetType type, const QBrush * ) | 250 | rounded, WidgetType type, const QBrush * ) |
251 | { | 251 | { |
252 | if ( w <= 0 || h <= 0 ) | ||
253 | return; | ||
254 | |||
252 | int offset = borderPixmap( type ) ? 0 : decoWidth( type ); | 255 | int offset = borderPixmap( type ) ? 0 : decoWidth( type ); |
253 | QPen oldPen = p->pen(); | 256 | QPen oldPen = p->pen(); |
@@ -288,7 +291,8 @@ void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, | |||
288 | g.brush( QColorGroup::Button ) ); | 291 | g.brush( QColorGroup::Button ) ); |
289 | } | 292 | } |
290 | if ( borderPixmap( type ) ) | 293 | if ( borderPixmap( type ) ) { |
291 | bitBlt( p->device(), x, y, scaleBorder( w, h, type ), 0, 0, w, h, | 294 | bitBlt( p->device(), x, y, scaleBorder( w, h, type ), 0, 0, w, h, |
292 | Qt::CopyROP, false ); | 295 | Qt::CopyROP, false ); |
296 | } | ||
293 | else | 297 | else |
294 | drawShade( p, x, y, w, h, g, sunken, rounded, | 298 | drawShade( p, x, y, w, h, g, sunken, rounded, |