From 9e755f078a806d6c81e1dbdbc54d12888041bbff Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 22 Feb 2005 22:46:25 +0000 Subject: Do not scale the buttons in the decoration over and over again. The logic was if the requested size is not the size of the pixmap load and scale it to the right size. The problem was the scaleButton method was changed to not scale the pixmap (to avoid bluring al will kill me for that) if the delta of the sizes was <= 4. We now do not try to scale if the delta is <= 4 --- (limited to 'library') diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp index fa38180..fb47c14 100644 --- a/library/qpedecoration_qws.cpp +++ b/library/qpedecoration_qws.cpp @@ -309,7 +309,7 @@ void QPEManager::whatsThisTimeout() static QImage *okImage( int th ) { static QImage *i = 0; - if ( !i || i->height() != th ) { + if ( !i || ::abs( i->height()-th ) > 4 ) { delete i; i = new QImage(scaleButton(Resource::loadImage("OKButton"),th)); } @@ -319,7 +319,7 @@ static QImage *okImage( int th ) static QImage *closeImage( int th ) { static QImage *i = 0; - if ( !i || i->height() != th ) { + if ( !i || ::abs( i->height()-th ) > 4 ) { delete i; i = new QImage(scaleButton(Resource::loadImage("CloseButton"),th)); } @@ -329,7 +329,7 @@ static QImage *closeImage( int th ) static QImage *helpImage( int th ) { static QImage *i = 0; - if ( !i || i->height() != th ) { + if ( !i || ::abs( i->height()-th ) > 4 ) { delete i; i = new QImage(scaleButton(Resource::loadImage("HelpButton"),th)); } @@ -339,7 +339,7 @@ static QImage *helpImage( int th ) static QImage *maximizeImage( int th ) { static QImage *i = 0; - if ( !i || i->height() != th ) { + if ( !i || ::abs( i->height()-th ) > 4 ) { delete i; i = new QImage(scaleButton(Resource::loadImage("MaximizeButton"),th)); } -- cgit v0.9.0.2