summaryrefslogtreecommitdiff
authorzecke <zecke>2005-02-22 22:46:25 (UTC)
committer zecke <zecke>2005-02-22 22:46:25 (UTC)
commit9e755f078a806d6c81e1dbdbc54d12888041bbff (patch) (side-by-side diff)
tree0b49051c792eee3bb09674568e492cdac145de18
parente33e10f5643a2fb5c640667939e4139bf7b580e2 (diff)
downloadopie-9e755f078a806d6c81e1dbdbc54d12888041bbff.zip
opie-9e755f078a806d6c81e1dbdbc54d12888041bbff.tar.gz
opie-9e755f078a806d6c81e1dbdbc54d12888041bbff.tar.bz2
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
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp8
1 files changed, 4 insertions, 4 deletions
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
@@ -308,9 +308,9 @@ 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));
}
return i;
@@ -318,9 +318,9 @@ 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));
}
return i;
@@ -328,9 +328,9 @@ 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));
}
return i;
@@ -338,9 +338,9 @@ 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));
}
return i;