diff options
author | Sami Merilä <sami.merila@nokia.com> | 2009-09-22 08:25:26 (GMT) |
---|---|---|
committer | Sami Merilä <sami.merila@nokia.com> | 2009-09-22 08:25:26 (GMT) |
commit | c0f1055fe809e6f4c90ea7ba3c369b2c01aaae07 (patch) | |
tree | 5271177e653b70d7cfe6e5cad9d26ff884712785 /src/gui/widgets/qmenu_symbian.cpp | |
parent | f5ea4ff7ce22f2f16f14b134908aa53c48633584 (diff) | |
download | Qt-c0f1055fe809e6f4c90ea7ba3c369b2c01aaae07.zip Qt-c0f1055fe809e6f4c90ea7ba3c369b2c01aaae07.tar.gz Qt-c0f1055fe809e6f4c90ea7ba3c369b2c01aaae07.tar.bz2 |
Remove key accelerators from Softkeys and Menus in S60.
In S60 softkeys and menu items do not support key accelerators (i.e.
CTRL+X). Therefore, removing the accelerator characters from both softkey
and menu item texts.
Related to task QT-1505 "Make Qt dialogs look native"
Reviewed by Jason Barron
Diffstat (limited to 'src/gui/widgets/qmenu_symbian.cpp')
-rw-r--r-- | src/gui/widgets/qmenu_symbian.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 00ceb98..13830ba 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -103,22 +103,6 @@ static bool hasContextMenu(QWidget* widget) } return false; } -// ### FIX THIS, copy/paste of original (faulty) stripped text implementation. -// Implementation should be removed from QAction implementation to some generic place -static QString qt_strippedText_copy_from_qaction(QString s) -{ - s.remove(QString::fromLatin1("...")); - int i = 0; - while (i < s.size()) { - ++i; - if (s.at(i-1) != QLatin1Char('&')) - continue; - if (i < s.size() && s.at(i) == QLatin1Char('&')) - ++i; - s.remove(i-1,1); - } - return s.trimmed(); -}; static SymbianMenuItem* qt_symbian_find_menu(int id, const QList<SymbianMenuItem*> &parent) { @@ -161,11 +145,9 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe if (action->action->isSeparator()) return; -// ### FIX THIS, the qt_strippedText2 doesn't work perfectly for stripping & marks. Same bug is in QAction -// New really working method is needed in a place where the implementation isn't copy/pasted - QString text = qt_strippedText_copy_from_qaction(action->action->text()); - TPtrC menuItemText(qt_QString2TPtrC(text)); - + const int underlineShortCut = QApplication::style()->styleHint(QStyle::SH_UnderlineShortcut); + QString iconText = action->action->iconText(); + TPtrC menuItemText = qt_QString2TPtrC( underlineShortCut ? action->action->text() : iconText); if (action->action->menu()) { SymbianMenuItem* menuItem = new SymbianMenuItem(); menuItem->menuItemData.iCascadeId = action->command; |