diff options
author | Janne Anttila <janne.anttila@digia.com> | 2010-03-03 07:16:15 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2010-03-03 07:16:51 (GMT) |
commit | 28803715e55b3dc0b017f8e3731920516959894f (patch) | |
tree | ed95e22496e868b33a26cba4054e9695c749b93d /src/gui/kernel/qsoftkeymanager_s60.cpp | |
parent | 6b674ae7459cf8a391a10c3b61fee525add35f98 (diff) | |
download | Qt-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/gui/kernel/qsoftkeymanager_s60.cpp')
-rw-r--r-- | src/gui/kernel/qsoftkeymanager_s60.cpp | 13 |
1 files changed, 10 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; } |