summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/othemestyle.cpp
authorsandman <sandman>2002-11-28 00:37:59 (UTC)
committer sandman <sandman>2002-11-28 00:37:59 (UTC)
commit0d508bf39ad43aa06c9cd395dd382d8e00dfbf3a (patch) (side-by-side diff)
treef4a225c3236b2608c1127e62750c4106e35bfd66 /noncore/styles/theme/othemestyle.cpp
parent57ad30fb514428e068142e31ee40aa1615291123 (diff)
downloadopie-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/othemestyle.cpp') (more/less context) (ignore 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
@@ -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() );