From 46fac384c74474f829d2bafba5c6324317500a5b Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Dec 16 2020 07:50:32 +0000 Subject: additional fix for accelerator key --- diff --git a/toonz/sources/toonz/commandbarpopup.cpp b/toonz/sources/toonz/commandbarpopup.cpp index b11597a..baea1c3 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 708aa62..e79c4b4 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();