summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp55
1 files changed, 15 insertions, 40 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index fb47c14..1afae88 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -306,44 +306,19 @@ void QPEManager::whatsThisTimeout()
306 306
307//=========================================================================== 307//===========================================================================
308 308#define IMAGE_METHOD( methodName, imageName ) \
309static QImage *okImage( int th ) 309static QImage* methodName( int th ) { \
310{ 310 static QImage *i = 0; \
311 static QImage *i = 0; 311 if ( !i || ::abs( i->height()-th ) > 4 ) { \
312 if ( !i || ::abs( i->height()-th ) > 4 ) { 312 delete i; \
313 delete i; 313 i = new QImage(scaleButton(Resource::loadImage(#imageName),th)); \
314 i = new QImage(scaleButton(Resource::loadImage("OKButton"),th)); 314 } \
315 } 315 \
316 return i; 316 return i; \
317} 317}
318 318
319static QImage *closeImage( int th ) 319IMAGE_METHOD(okImage, OKButton );
320{ 320IMAGE_METHOD(closeImage, CloseButton );
321 static QImage *i = 0; 321IMAGE_METHOD(helpImage, HelpButton );
322 if ( !i || ::abs( i->height()-th ) > 4 ) { 322IMAGE_METHOD(maximizeImage,MaximizeButton );
323 delete i;
324 i = new QImage(scaleButton(Resource::loadImage("CloseButton"),th));
325 }
326 return i;
327}
328
329static QImage *helpImage( int th )
330{
331 static QImage *i = 0;
332 if ( !i || ::abs( i->height()-th ) > 4 ) {
333 delete i;
334 i = new QImage(scaleButton(Resource::loadImage("HelpButton"),th));
335 }
336 return i;
337}
338
339static QImage *maximizeImage( int th )
340{
341 static QImage *i = 0;
342 if ( !i || ::abs( i->height()-th ) > 4 ) {
343 delete i;
344 i = new QImage(scaleButton(Resource::loadImage("MaximizeButton"),th));
345 }
346 return i;
347}
348 323
349int WindowDecorationInterface::metric( Metric m, const WindowData *wd ) const 324int WindowDecorationInterface::metric( Metric m, const WindowData *wd ) const