From e45ee44ae6fd1e0959bc9378bbe6148513dd56b7 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 27 Mar 2023 12:00:27 +0200 Subject: [PATCH] Terminal: Use native shortcut representation Changes the ESC configure button to display the native representation of the ESC Key instead of the macOS specific one. Change-Id: Id3ec69901afb2bcb8b352b9c50a1adb4a074cd74 Reviewed-by: Qt CI Bot Reviewed-by: hjk --- src/plugins/terminal/terminalpane.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index 247f8d8f16c..3d110e764ee 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -132,12 +132,15 @@ TerminalPane::TerminalPane(QObject *parent) auto updateEscButton = [this] { m_escSettingButton->setChecked(TerminalSettings::instance().sendEscapeToTerminal.value()); + static QString escKey = QKeySequence(Qt::Key_Escape).toString(QKeySequence::NativeText); + static QString shiftEsc = QKeySequence(QKeyCombination(Qt::ShiftModifier, Qt::Key_Escape)) + .toString(QKeySequence::NativeText); if (TerminalSettings::instance().sendEscapeToTerminal.value()) { - m_escSettingButton->setText("⎋"); + m_escSettingButton->setText(escKey); m_escSettingButton->setToolTip(Tr::tr("Sending ESC to terminal instead of Qt Creator")); } else { - m_escSettingButton->setText("⇧+⎋"); - m_escSettingButton->setToolTip(Tr::tr("Press ⇧+⎋ to send ESC to terminal")); + m_escSettingButton->setText(shiftEsc); + m_escSettingButton->setToolTip(Tr::tr("Press %1 to send ESC to terminal").arg(shiftEsc)); } };