summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-03-02 14:03:26 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-03-02 14:03:26 (GMT)
commita76d12862122504bae2e75cb78bdb21d180aaca0 (patch)
tree5e6941564c2a49a44731664f482cd639ad3ec761
parent94b2938086203bc6154b107c518df7a6fbfb4b2c (diff)
downloadQt-a76d12862122504bae2e75cb78bdb21d180aaca0.zip
Qt-a76d12862122504bae2e75cb78bdb21d180aaca0.tar.gz
Qt-a76d12862122504bae2e75cb78bdb21d180aaca0.tar.bz2
Re-applied a fix which get lost during softkey refactoring.
See original commit (b461da1040c32d6690870290d6716a3b5cb7e9e9) for more information. Task-number: QTBUG-6220 Reviewed-By: TrustMe
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp7
-rw-r--r--src/gui/widgets/qmainwindow.cpp1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 2a1ecc5..dedf0a1 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -284,7 +284,12 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
TPtrC nativeText = qt_QString2TPtrC(text);
int command = S60_COMMAND_START + position;
setNativeSoftkey(cba, position, command, nativeText);
- cba.DimCommand(command, !action->isEnabled());
+ // QMainWindow "Options" action is set to invisible in order it does not appear in context menu
+ // and all invisible actions are by default disabled.
+ // However we never want to dim options softkey, even it is set to invisible
+ QVariant property = action->property(MENU_ACTION_PROPERTY);
+ const bool dimmed = (property.isValid() && property.toBool()) ? false : !action->isEnabled();
+ cba.DimCommand(command, dimmed);
realSoftKeyActions.insert(command, action);
return true;
}
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index e7c4f45..7e59bb0 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -119,6 +119,7 @@ void QMainWindowPrivate::init()
q->setAttribute(Qt::WA_Hover);
#ifdef QT_SOFTKEYS_ENABLED
menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, q);
+ menuBarAction->setVisible(false);
#endif
}