MenuBar: Update checkmarked Select State Slot when hotkey pressed

Update the checkmarked slot in the Select State Slot menu when the
Increase Selected State Slot or Decrease Selected State Slot hotkeys are
pressed.

The actual selected save slot was being changed correctly before this
commit; this just fixes the menu checkmark.
This commit is contained in:
Dentomologist 2024-08-12 23:57:57 -07:00
parent 5af0ae25e6
commit 134313e313
1 changed files with 4 additions and 0 deletions

View File

@ -408,6 +408,10 @@ void MenuBar::AddStateSlotMenu(QMenu* emu_menu)
action->setChecked(true);
connect(action, &QAction::triggered, this, [=, this]() { emit SetStateSlot(i); });
connect(this, &MenuBar::SetStateSlot, [action, i](const int slot) {
if (slot == i)
action->setChecked(true);
});
}
}