chore(macOS): use native text for ShortcutEdit's label
This means that it will be shown translated and on Apple platforms it will resemble a key sequence from the menu bar.
This commit is contained in:
parent
cbd006bae7
commit
3203d7f598
@ -105,8 +105,8 @@ ShortcutEdit::ShortcutEdit(QWidget *parent)
|
|||||||
|
|
||||||
connect(this, &ShortcutEdit::shortcutsChanged, this, [=](){
|
connect(this, &ShortcutEdit::shortcutsChanged, this, [=](){
|
||||||
QStringList shortcutTexts;
|
QStringList shortcutTexts;
|
||||||
for (const QKeySequence & shortcut : m_shortcuts) {
|
for (const QKeySequence & shortcut : std::as_const(m_shortcuts)) {
|
||||||
shortcutTexts.append(shortcut.toString());
|
shortcutTexts.append(shortcut.toString(QKeySequence::NativeText));
|
||||||
}
|
}
|
||||||
m_shortcutsLabel->setText(shortcutTexts.isEmpty() ? tr("No shortcuts") : shortcutTexts.join(", "));
|
m_shortcutsLabel->setText(shortcutTexts.isEmpty() ? tr("No shortcuts") : shortcutTexts.join(", "));
|
||||||
m_shortcutsLabel->setDisabled(shortcutTexts.isEmpty());
|
m_shortcutsLabel->setDisabled(shortcutTexts.isEmpty());
|
||||||
|
Loading…
Reference in New Issue
Block a user