summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/ogfxeffect.cpp6
-rw-r--r--noncore/styles/theme/othemestyle.cpp6
2 files changed, 9 insertions, 3 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
@@ -27,9 +27,10 @@
QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca,
const QColor &cb, GradientType eff, int ncols)
{
+ if ( !pixmap. isNull ( )) {
QImage image = gradient(pixmap.size(), ca, cb, eff, ncols);
pixmap.convertFromImage(image);
-
+ }
return pixmap;
}
@@ -280,6 +281,7 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity,
const QColor &bgnd, GradientType eff,
bool anti_dir, int /*ncols*/)
{
+ if ( !pixmap. isNull ( )) {
QImage image = pixmap.convertToImage();
OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir);
@@ -287,7 +289,7 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity,
image. convertDepth ( pixmap. depth ( ));
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
@@ -249,6 +249,9 @@ void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken, bool
rounded, WidgetType type, const QBrush * )
{
+ if ( w <= 0 || h <= 0 )
+ return;
+
int offset = borderPixmap( type ) ? 0 : decoWidth( type );
QPen oldPen = p->pen();
@@ -287,9 +290,10 @@ void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h,
p->fillRect( x + offset, y + offset, w - offset * 2, h - offset * 2,
g.brush( QColorGroup::Button ) );
}
- if ( borderPixmap( type ) )
+ if ( borderPixmap( type ) ) {
bitBlt( p->device(), x, y, scaleBorder( w, h, type ), 0, 0, w, h,
Qt::CopyROP, false );
+ }
else
drawShade( p, x, y, w, h, g, sunken, rounded,
highlightWidth( type ), borderWidth( type ), shade() );