Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

additional fix for accelerator key

shun-iwasawa46fac384c744
diff --git a/toonz/sources/toonz/commandbarpopup.cpp b/toonz/sources/toonz/commandbarpopup.cpp
index b11597a3b..baea1c3c1 100644
--- a/toonz/sources/toonz/commandbarpopup.cpp
+++ b/toonz/sources/toonz/commandbarpopup.cpp
@@ -45,9 +45,9 @@ public:
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled |
Qt::ItemNeverHasChildren);
QString tempText = m_action->text();
- if (tempText.indexOf("&") == 0) {
- tempText = tempText.remove(0, 1);
- }
+ // removing accelerator key indicator
+ tempText = tempText.replace(QRegExp("&([^& ])"), "\\1");
+ // removing doubled &s
tempText = tempText.replace("&&", "&");
setText(0, tempText);
setToolTip(0, QObject::tr("[Drag] to move position"));
diff --git a/toonz/sources/toonz/shortcutpopup.cpp b/toonz/sources/toonz/shortcutpopup.cpp
index 708aa622a..e79c4b470 100644
--- a/toonz/sources/toonz/shortcutpopup.cpp
+++ b/toonz/sources/toonz/shortcutpopup.cpp
@@ -57,9 +57,9 @@ public:
}
void updateText() {
QString text = m_action->text();
- if (text.indexOf("&") == 0) {
- text = text.remove(0, 1);
- }
+ // removing accelerator key indicator
+ text = text.replace(QRegExp("&([^& ])"), "\\1");
+ // removing doubled &s
text = text.replace("&&", "&");
setText(0, text);
QString shortcut = m_action->shortcut().toString();