summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-12-08 07:57:08 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-12-08 07:59:20 (GMT)
commit854d8960b98a691094ac51ad69b60d6a3a798ac2 (patch)
tree9554fae82b46d9b645004dd5c9350f085e776742 /src
parent41754fdb11a4d78b7b756b82d4ead235b6618687 (diff)
downloadQt-854d8960b98a691094ac51ad69b60d6a3a798ac2.zip
Qt-854d8960b98a691094ac51ad69b60d6a3a798ac2.tar.gz
Qt-854d8960b98a691094ac51ad69b60d6a3a798ac2.tar.bz2
Minor fixes to softkey dimming support (commit 245c9cc0).
In Qt invisible actions are disabled by default, and our "Options" softkey is set to invisible in order that it is not show in context menu. Thus we need don't want to dim in softkey even it is disabled. Additionally, QDialogButtonEnabledProxy need to set the initial enabled state for proxy action from button. Fixes bugs in commit: 245c9cc0 Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp6
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 464a250..0e98f39 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -250,13 +250,17 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys)
? EAknSoftkeyOptions
: s60CommandStart + index;
+ // _q_menuSoftKeyAction action is set to "invisible" and all invisible actions are by default
+ // disabled. However we never want to dim options softkey, even it is set to "invisible"
+ bool dimmed = (command == EAknSoftkeyOptions) ? false : !softKeyAction->isEnabled();
+
if (position != -1) {
const int underlineShortCut = QApplication::style()->styleHint(QStyle::SH_UnderlineShortcut);
QString iconText = softKeyAction->iconText();
TPtrC text = qt_QString2TPtrC( underlineShortCut ? softKeyAction->text() : iconText);
QT_TRAP_THROWING(
nativeContainer->SetCommandL(position, command, text);
- nativeContainer->DimCommand(command, !softKeyAction->isEnabled());
+ nativeContainer->DimCommand(command, dimmed);
);
}
}
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 56cf545..9512785 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -265,6 +265,7 @@ public:
QDialogButtonEnabledProxy(QObject *parent, QWidget *src, QAction *trg) : QObject(parent), source(src), target(trg)
{
source->installEventFilter(this);
+ target->setEnabled(source->isEnabled());
}
~QDialogButtonEnabledProxy()
{