summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp31
-rw-r--r--src/gui/kernel/qsoftkeymanager_common_p.h3
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp4
-rw-r--r--src/gui/kernel/qwidget_s60.cpp3
-rw-r--r--src/gui/styles/qs60style.cpp5
5 files changed, 43 insertions, 3 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 1b26933..204efe9 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -50,6 +50,10 @@
#include "private/qsoftkeymanager_s60_p.h"
#endif
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+#include "private/qt_s60_p.h"
+#endif
+
#ifndef QT_NO_SOFTKEYMANAGER
QT_BEGIN_NAMESPACE
@@ -101,6 +105,30 @@ QSoftKeyManager::QSoftKeyManager() :
QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget)
{
QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget);
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+ int key = 0;
+ switch (standardKey) {
+ case OkSoftKey:
+ key = EAknSoftkeyOk;
+ break;
+ case SelectSoftKey:
+ key = EAknSoftkeySelect;
+ break;
+ case DoneSoftKey:
+ key = EAknSoftkeyDone;
+ break;
+ case MenuSoftKey:
+ key = EAknSoftkeyOptions;
+ break;
+ case CancelSoftKey:
+ key = EAknSoftkeyCancel;
+ break;
+ default:
+ break;
+ };
+ if (key != 0)
+ QSoftKeyManager::instance()->d_func()->softKeyCommandActions.insert(action, key);
+#endif
QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
case MenuSoftKey: // FALL-THROUGH
@@ -143,6 +171,9 @@ void QSoftKeyManager::cleanupHash(QObject *obj)
Q_D(QSoftKeyManager);
QAction *action = qobject_cast<QAction*>(obj);
d->keyedActions.remove(action);
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+ d->softKeyCommandActions.remove(action);
+#endif
}
void QSoftKeyManager::sendKeyEvent()
diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h
index 27d8ee9..02ae697 100644
--- a/src/gui/kernel/qsoftkeymanager_common_p.h
+++ b/src/gui/kernel/qsoftkeymanager_common_p.h
@@ -72,6 +72,9 @@ protected:
QMultiHash<int, QAction*> requestedSoftKeyActions;
QWidget *initialSoftKeySource;
bool pendingUpdate;
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+ QHash<QAction*, int> softKeyCommandActions;
+#endif
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 09e2b5f..79ed91a 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -298,6 +298,10 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
QString text = softkeyText(*action);
TPtrC nativeText = qt_QString2TPtrC(text);
int command = S60_COMMAND_START + position;
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+ if (softKeyCommandActions.contains(action))
+ command = softKeyCommandActions.value(action);
+#endif
setNativeSoftkey(cba, position, command, nativeText);
const bool dimmed = !action->isEnabled() && !QSoftKeyManager::isForceEnabledInSofkeys(action);
cba.DimCommand(command, dimmed);
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index e7d5e95..8b57701 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1451,7 +1451,8 @@ void QWidget::activateWindow()
if (tlw->isVisible()) {
window()->createWinId();
QSymbianControl *id = static_cast<QSymbianControl *>(tlw->internalWinId());
- id->setFocusSafely(true);
+ if (!id->IsFocused())
+ id->setFocusSafely(true);
}
}
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index da1528e..05243a7 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2282,8 +2282,9 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
//Need extra check since dialogs have their own theme background
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)
&& QS60StylePrivate::equalToThemePalette(option->palette.window().texture().cacheKey(), QPalette::Window)) {
+ const bool comboMenu = qobject_cast<const QComboBoxListView *>(widget);
// Add margin area to the background, to avoid background being cut for first and last item.
- const int verticalMenuAdjustment = QS60StylePrivate::pixelMetric(PM_MenuVMargin);
+ const int verticalMenuAdjustment = comboMenu ? QS60StylePrivate::pixelMetric(PM_MenuVMargin) : 0;
const QRect adjustedMenuRect = option->rect.adjusted(0, -verticalMenuAdjustment, 0, verticalMenuAdjustment);
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, adjustedMenuRect, flags);
} else {
@@ -2641,7 +2642,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
case CT_ItemViewItem:
if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
- sz = QSize(menuItem->rect.width(), 1);
+ sz = QSize(menuItem->rect.width() - 2 * pixelMetric(PM_MenuHMargin) - 2 * QS60StylePrivate::pixelMetric(PM_FrameCornerWidth), 1);
break;
}
}