mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-12 06:33:59 +00:00
Fix Select All menu match on standard shortcut text
This commit is contained in:
@@ -5057,10 +5057,16 @@ void Widget::handleFieldContextMenuRequest(
|
||||
_state->richPage(),
|
||||
_state->activeLeafPath(),
|
||||
_field->isHidden())) {
|
||||
const auto selectAll = QKeySequence(QKeySequence::SelectAll);
|
||||
const auto selectAllShortcut = QKeySequence(
|
||||
QKeySequence::SelectAll).toString(QKeySequence::NativeText);
|
||||
const auto shortcutText = [](const QString &text) {
|
||||
const auto tab = text.indexOf(QChar('\t'));
|
||||
return (tab >= 0) ? text.mid(tab + 1) : QString();
|
||||
};
|
||||
for (const auto action : request.menu->actions()) {
|
||||
if (action->shortcut() == selectAll
|
||||
|| action->shortcuts().contains(selectAll)) {
|
||||
if (!action->isSeparator()
|
||||
&& !selectAllShortcut.isEmpty()
|
||||
&& shortcutText(action->text()) == selectAllShortcut) {
|
||||
QObject::disconnect(
|
||||
action,
|
||||
&QAction::triggered,
|
||||
|
||||
Reference in New Issue
Block a user