diff options
author | Sami Merilä <sami.merila@nokia.com> | 2009-11-09 13:00:42 (GMT) |
---|---|---|
committer | Sami Merilä <sami.merila@nokia.com> | 2009-11-09 13:00:42 (GMT) |
commit | e55d77afa7f53562d4b9f0aebd30725e5f4fde86 (patch) | |
tree | e821103fad4dfc313bfeb7a3e21e95290a8ef8b1 /src | |
parent | d9a275b3cc4a248da1f392fb5649b9fe7a93b12c (diff) | |
download | Qt-e55d77afa7f53562d4b9f0aebd30725e5f4fde86.zip Qt-e55d77afa7f53562d4b9f0aebd30725e5f4fde86.tar.gz Qt-e55d77afa7f53562d4b9f0aebd30725e5f4fde86.tar.bz2 |
Focus changes cause softkey area to flicker
Current implementation of softkeys causes flicker, since it re-draws
the softkeys for each event handled.
First re-draw initializes the softkeys to empty ones, and second one
draws the new updated softkeys onscreen. Due to initialization to
empty softkey command set, AVKON cannot deduce if the needed redraw
is necessary (AVKON does not redraw softkeys if the softkey commands
and/or texts won't change).
The fixed behaviour is that softkeys are set to -1 for each command
when initializing, but no call to SetCommandSetL is done. Now, AVKON
won't even try to draw the softkeys until we set the real command set
later.
Task-number: QTBUG-5436
Reviewed-by: Janne Anttila
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index ecad72f..6d148fe 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -213,11 +213,14 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys) CEikButtonGroupContainer* nativeContainer = S60->buttonGroupContainer(); nativeContainer->DrawableWindow()->SetOrdinalPosition(0); nativeContainer->DrawableWindow()->SetPointerCapturePriority(1); //keep softkeys available in modal dialog - QT_TRAP_THROWING(nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS)); int position = -1; - int command; bool needsExitButton = true; + QT_TRAP_THROWING( + //Using -1 instead of EAknSoftkeyEmpty to avoid flickering. + nativeContainer->SetCommandL(0, -1, KNullDesC); + nativeContainer->SetCommandL(2, -1, KNullDesC); + ); for (int index = 0; index < softkeys.count(); index++) { const QAction* softKeyAction = softkeys.at(index); @@ -238,7 +241,7 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys) break; } - command = (softKeyAction->objectName().contains("_q_menuSoftKeyAction")) + int command = (softKeyAction->objectName().contains("_q_menuSoftKeyAction")) ? EAknSoftkeyOptions : s60CommandStart + index; @@ -255,7 +258,8 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys) : Qt::Widget; if (needsExitButton && sourceWindowType != Qt::Dialog && sourceWindowType != Qt::Popup) - QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QSoftKeyManager::tr("Exit")))); + QT_TRAP_THROWING( + nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QSoftKeyManager::tr("Exit")))); nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation } |