summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-03-03 07:16:15 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-03-03 07:16:51 (GMT)
commit28803715e55b3dc0b017f8e3731920516959894f (patch)
treeed95e22496e868b33a26cba4054e9695c749b93d /src
parent6b674ae7459cf8a391a10c3b61fee525add35f98 (diff)
downloadQt-28803715e55b3dc0b017f8e3731920516959894f.zip
Qt-28803715e55b3dc0b017f8e3731920516959894f.tar.gz
Qt-28803715e55b3dc0b017f8e3731920516959894f.tar.bz2
Reduced S60 softkey flickering caused by softkey image support.
EikSoftkeyImage::SetLabel call seems to clear and redraw the softkeys every time when called. This commit removes the unnecessary calls to the method if given CBA is already in text mode. Reviewed-By: Sami Merila
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp13
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60_p.h2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index dedf0a1..3a0304c 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -60,7 +60,7 @@ const int LSK_POSITION = 0;
const int MSK_POSITION = 3;
const int RSK_POSITION = 2;
-QSoftKeyManagerPrivateS60::QSoftKeyManagerPrivateS60()
+QSoftKeyManagerPrivateS60::QSoftKeyManagerPrivateS60() : cbaHasImage(4) // 4 since MSK position index is 3
{
cachedCbaIconSize[0] = QSize(0,0);
cachedCbaIconSize[1] = QSize(0,0);
@@ -265,10 +265,14 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba,
myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered
EikSoftkeyImage::SetImage(cba, *myimage, left); // Takes myimage ownership
+ cbaHasImage[position] = true;
ret = true;
} else {
// Restore softkey to text based
- EikSoftkeyImage::SetLabel(cba, left);
+ if (cbaHasImage[position]) {
+ EikSoftkeyImage::SetLabel(cba, left);
+ cbaHasImage[position] = false;
+ }
}
}
return ret;
@@ -326,7 +330,10 @@ bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba)
if (windowType != Qt::Dialog && windowType != Qt::Popup) {
QString text(QSoftKeyManager::tr("Exit"));
TPtrC nativeText = qt_QString2TPtrC(text);
- EikSoftkeyImage::SetLabel(&cba, false);
+ if (cbaHasImage[RSK_POSITION]) {
+ EikSoftkeyImage::SetLabel(&cba, false);
+ cbaHasImage[RSK_POSITION] = false;
+ }
setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText);
return true;
}
diff --git a/src/gui/kernel/qsoftkeymanager_s60_p.h b/src/gui/kernel/qsoftkeymanager_s60_p.h
index 823a2db..a5e5016 100644
--- a/src/gui/kernel/qsoftkeymanager_s60_p.h
+++ b/src/gui/kernel/qsoftkeymanager_s60_p.h
@@ -53,6 +53,7 @@
// We mean it.
//
+#include "qbitarray.h"
#include "private/qobject_p.h"
#include "private/qsoftkeymanager_common_p.h"
@@ -98,6 +99,7 @@ private:
private:
QHash<int, QAction*> realSoftKeyActions;
QSize cachedCbaIconSize[4];
+ QBitArray cbaHasImage;
};