summaryrefslogtreecommitdiff
path: root/noncore/decorations/flat/flat.cpp
Unidiff
Diffstat (limited to 'noncore/decorations/flat/flat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/decorations/flat/flat.cpp4
1 files changed, 2 insertions, 2 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
@@ -265,84 +265,84 @@ void FlatDecoration::drawArea( Area a, QPainter *p, const WindowData *wd ) const
265 case Title: 265 case Title:
266 if ( r.height() < 2 ) { 266 if ( r.height() < 2 ) {
267 WindowDecorationInterface::drawArea( a, p, wd ); 267 WindowDecorationInterface::drawArea( a, p, wd );
268 } else { 268 } else {
269 const QColorGroup &cg = wd->palette.active(); 269 const QColorGroup &cg = wd->palette.active();
270 QColor c; 270 QColor c;
271 if ( wd->flags & WindowData::Active ) 271 if ( wd->flags & WindowData::Active )
272 c = cg.color(QColorGroup::Highlight); 272 c = cg.color(QColorGroup::Highlight);
273 else 273 else
274 c = cg.color(QColorGroup::Background); 274 c = cg.color(QColorGroup::Background);
275 p->fillRect( QRect(r.x(),r.y()-th,r.width(),th), c ); 275 p->fillRect( QRect(r.x(),r.y()-th,r.width(),th), c );
276 } 276 }
277 break; 277 break;
278 case TitleText: 278 case TitleText:
279 p->drawText( r.left()+3+metric(HelpWidth,wd), r.top()-th, 279 p->drawText( r.left()+3+metric(HelpWidth,wd), r.top()-th,
280 r.width()-metric(HelpWidth,wd)-metric(CloseWidth,wd), th, 280 r.width()-metric(HelpWidth,wd)-metric(CloseWidth,wd), th,
281 Qt::AlignVCenter, wd->caption ); 281 Qt::AlignVCenter, wd->caption );
282 break; 282 break;
283 default: 283 default:
284 FlatDecoration::drawArea( a, p, wd ); 284 FlatDecoration::drawArea( a, p, wd );
285 break; 285 break;
286 } 286 }
287} 287}
288 288
289void FlatDecoration::drawButton( Button b, QPainter *p, const WindowData *wd, int x, int y, int w, int h, QWSButton::State state ) const 289void FlatDecoration::drawButton( Button b, QPainter *p, const WindowData *wd, int x, int y, int, int, QWSButton::State state ) const
290{ 290{
291 QColor c; 291 QColor c;
292 const QColorGroup &cg = wd->palette.active(); 292 const QColorGroup &cg = wd->palette.active();
293 if ( wd->flags & WindowDecorationInterface::WindowData::Active ) 293 if ( wd->flags & WindowDecorationInterface::WindowData::Active )
294 c = cg.color(QColorGroup::HighlightedText); 294 c = cg.color(QColorGroup::HighlightedText);
295 else 295 else
296 c = cg.color(QColorGroup::Foreground); 296 c = cg.color(QColorGroup::Foreground);
297 bool r = (state & QWSButton::MouseOver) && (state & QWSButton::Clicked); 297 bool r = (state & QWSButton::MouseOver) && (state & QWSButton::Clicked);
298 int th = metric(TitleHeight, wd); 298 int th = metric(TitleHeight, wd);
299 299
300 QString key( "%1-%2-%3-%4" ); 300 QString key( "%1-%2-%3-%4" );
301 key = key.arg(b).arg(th).arg(c.name()).arg(r ? "1" : "0"); 301 key = key.arg(b).arg(th).arg(c.name()).arg(r ? "1" : "0");
302 QImage *img = buttonCache.find( key ); 302 QImage *img = buttonCache.find( key );
303 if ( !img ) { 303 if ( !img ) {
304 QImage tmp; 304 QImage tmp;
305 switch ( b ) { 305 switch ( b ) {
306 case OK: 306 case OK:
307 tmp = QImage( ok_xpm ); 307 tmp = QImage( ok_xpm );
308 break; 308 break;
309 case Close: 309 case Close:
310 tmp = QImage( close_xpm ); 310 tmp = QImage( close_xpm );
311 break; 311 break;
312 case Help: 312 case Help:
313 tmp = QImage( help_xpm ); 313 tmp = QImage( help_xpm );
314 break; 314 break;
315 case Maximize: 315 case Maximize:
316 tmp = QImage( maximize_xpm ); 316 tmp = QImage( maximize_xpm );
317 break; 317 break;
318 } 318 }
319 colorize( tmp, c, r ); 319 colorize( tmp, c, r );
320 img = new QImage( scaleButton(tmp,th) ); 320 img = new QImage( scaleButton(tmp,th) );
321 FlatDecoration *that = (FlatDecoration *)this; 321 FlatDecoration *that = (FlatDecoration *)this;
322 that->buttonCache.insert( key, img, 1 ); 322 that->buttonCache.insert( key, img, 1 );
323 } 323 }
324 324
325 p->drawImage( x, y, *img ); 325 p->drawImage( x, y, *img );
326} 326}
327 327
328QRegion FlatDecoration::mask( const WindowData *wd ) const 328QRegion FlatDecoration::mask( const WindowData *wd ) const
329{ 329{
330 return WindowDecorationInterface::mask( wd ); 330 return WindowDecorationInterface::mask( wd );
331} 331}
332 332
333QString FlatDecoration::name() const 333QString FlatDecoration::name() const
334{ 334{
335 return qApp->translate( "Decoration", "Flat" ); 335 return qApp->translate( "Decoration", "Flat" );
336} 336}
337 337
338QPixmap FlatDecoration::icon() const 338QPixmap FlatDecoration::icon() const
339{ 339{
340 return QPixmap(); 340 return QPixmap();
341} 341}
342 342
343QRESULT FlatDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) 343QRESULT FlatDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
344{ 344{
345 *iface = 0; 345 *iface = 0;
346 if ( uuid == IID_QUnknown ) 346 if ( uuid == IID_QUnknown )
347 *iface = this; 347 *iface = this;
348 else if ( uuid == IID_WindowDecoration ) 348 else if ( uuid == IID_WindowDecoration )