forked from qt-creator/qt-creator
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:
@@ -132,12 +132,15 @@ TerminalPane::TerminalPane(QObject *parent)
|
|||||||
|
|
||||||
auto updateEscButton = [this] {
|
auto updateEscButton = [this] {
|
||||||
m_escSettingButton->setChecked(TerminalSettings::instance().sendEscapeToTerminal.value());
|
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()) {
|
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"));
|
m_escSettingButton->setToolTip(Tr::tr("Sending ESC to terminal instead of Qt Creator"));
|
||||||
} else {
|
} else {
|
||||||
m_escSettingButton->setText("⇧+⎋");
|
m_escSettingButton->setText(shiftEsc);
|
||||||
m_escSettingButton->setToolTip(Tr::tr("Press ⇧+⎋ to send ESC to terminal"));
|
m_escSettingButton->setToolTip(Tr::tr("Press %1 to send ESC to terminal").arg(shiftEsc));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user