summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/othemestyle.cpp
Unidiff
Diffstat (limited to 'noncore/styles/theme/othemestyle.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/othemestyle.cpp6
1 files changed, 5 insertions, 1 deletions
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
@@ -246,12 +246,15 @@ bool OThemeStyle::eventFilter ( QObject *obj, QEvent *ev )
246} 246}
247 247
248void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h, 248void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h,
249 const QColorGroup &g, bool sunken, bool 249 const QColorGroup &g, bool sunken, bool
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();
254 257
255 // handle reverse bevel here since it uses decowidth differently 258 // handle reverse bevel here since it uses decowidth differently
256 if ( gradientHint( type ) == GrReverseBevel ) { 259 if ( gradientHint( type ) == GrReverseBevel ) {
257 int i; 260 int i;
@@ -284,15 +287,16 @@ void OThemeStyle::drawBaseButton( QPainter *p, int x, int y, int w, int h,
284 *scalePixmap( w - offset * 2, h - offset * 2, 287 *scalePixmap( w - offset * 2, h - offset * 2,
285 type ) ); 288 type ) );
286 else 289 else
287 p->fillRect( x + offset, y + offset, w - offset * 2, h - offset * 2, 290 p->fillRect( x + offset, y + offset, w - offset * 2, h - offset * 2,
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,
295 highlightWidth( type ), borderWidth( type ), shade() ); 299 highlightWidth( type ), borderWidth( type ), shade() );
296 } 300 }
297 p->setPen( oldPen ); 301 p->setPen( oldPen );
298} 302}