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 <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-03-27 12:00:27 +02:00
parent 193b1295f6
commit e45ee44ae6

View File

@@ -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));
}
};