UI: Options: Fix App Group Hot Key Shortcuts

This commit is contained in:
Nodir Temirkhodjaev 2024-04-05 13:07:03 +03:00
parent 8ef9f7e187
commit b14be00910

View File

@ -708,13 +708,17 @@ void TrayIcon::updateActionHotKeys()
for (auto action : hotKeyManager()->actions()) {
const auto &iniKey = m_actionIniKeys[index];
QString shortcutText = iniUser()->hotKeyValue(iniKey);
const QString shortcutText = iniUser()->hotKeyValue(iniKey);
QKeySequence shortcut = QKeySequence::fromString(shortcutText);
if (iniKey == HotKey::appGroupModifier) {
shortcutText += "+F" + QString::number(++groupIndex);
if (!shortcut.isEmpty() && iniKey == HotKey::appGroupModifier) {
const QKeyCombination key = shortcut[0];
shortcut = Qt::KeyboardModifiers(key & Qt::KeyboardModifierMask)
| (Qt::Key_F1 + groupIndex);
++groupIndex;
}
const QKeySequence shortcut = QKeySequence::fromString(shortcutText);
action->setShortcut(shortcut);
++index;