From 0ea37a28fc920d035e9b4e53e1fe0e6712b6d802 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 4 Jul 2026 15:52:56 +0400 Subject: [PATCH] Fix Select All menu match on standard shortcut text --- Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp b/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp index ca92a5d2b0..937e3d04a2 100644 --- a/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp +++ b/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp @@ -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,