summaryrefslogtreecommitdiff
path: root/noncore/decorations/flat/flat.cpp
Side-by-side diff
Diffstat (limited to 'noncore/decorations/flat/flat.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/decorations/flat/flat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/decorations/flat/flat.cpp b/noncore/decorations/flat/flat.cpp
index a2f12be..9a670cc 100644
--- a/noncore/decorations/flat/flat.cpp
+++ b/noncore/decorations/flat/flat.cpp
@@ -241,97 +241,97 @@ int FlatDecoration::metric( Metric m, const WindowData *wd ) const
void FlatDecoration::drawArea( Area a, QPainter *p, const WindowData *wd ) const
{
int th = metric( TitleHeight, wd );
QRect r = wd->rect;
switch ( a ) {
case Border:
{
const QColorGroup &cg = wd->palette.active();
if ( wd->flags & WindowData::Active ) {
p->setBrush( cg.color(QColorGroup::Highlight) );
} else {
p->setBrush( cg.color(QColorGroup::Background) );
}
p->setPen( cg.foreground() );
int lb = metric(LeftBorder,wd);
int rb = metric(RightBorder,wd);
int tb = metric(TopBorder,wd);
int bb = metric(BottomBorder,wd);
p->drawRect( r.x()-lb, r.y()-tb-th, r.width()+lb+rb,
r.height()+th+tb+bb );
}
break;
case Title:
if ( r.height() < 2 ) {
WindowDecorationInterface::drawArea( a, p, wd );
} else {
const QColorGroup &cg = wd->palette.active();
QColor c;
if ( wd->flags & WindowData::Active )
c = cg.color(QColorGroup::Highlight);
else
c = cg.color(QColorGroup::Background);
p->fillRect( QRect(r.x(),r.y()-th,r.width(),th), c );
}
break;
case TitleText:
p->drawText( r.left()+3+metric(HelpWidth,wd), r.top()-th,
r.width()-metric(HelpWidth,wd)-metric(CloseWidth,wd), th,
Qt::AlignVCenter, wd->caption );
break;
default:
FlatDecoration::drawArea( a, p, wd );
break;
}
}
-void FlatDecoration::drawButton( Button b, QPainter *p, const WindowData *wd, int x, int y, int w, int h, QWSButton::State state ) const
+void FlatDecoration::drawButton( Button b, QPainter *p, const WindowData *wd, int x, int y, int, int, QWSButton::State state ) const
{
QColor c;
const QColorGroup &cg = wd->palette.active();
if ( wd->flags & WindowDecorationInterface::WindowData::Active )
c = cg.color(QColorGroup::HighlightedText);
else
c = cg.color(QColorGroup::Foreground);
bool r = (state & QWSButton::MouseOver) && (state & QWSButton::Clicked);
int th = metric(TitleHeight, wd);
QString key( "%1-%2-%3-%4" );
key = key.arg(b).arg(th).arg(c.name()).arg(r ? "1" : "0");
QImage *img = buttonCache.find( key );
if ( !img ) {
QImage tmp;
switch ( b ) {
case OK:
tmp = QImage( ok_xpm );
break;
case Close:
tmp = QImage( close_xpm );
break;
case Help:
tmp = QImage( help_xpm );
break;
case Maximize:
tmp = QImage( maximize_xpm );
break;
}
colorize( tmp, c, r );
img = new QImage( scaleButton(tmp,th) );
FlatDecoration *that = (FlatDecoration *)this;
that->buttonCache.insert( key, img, 1 );
}
p->drawImage( x, y, *img );
}
QRegion FlatDecoration::mask( const WindowData *wd ) const
{
return WindowDecorationInterface::mask( wd );
}
QString FlatDecoration::name() const
{
return qApp->translate( "Decoration", "Flat" );
}