Windows: Hide accelerators when they are disabled.

Currently, mapping something to load state / save state / etc. causes the
default accelerators to become disabled.  In this case, it can be
confusing when the menu still shows them.

Fixes #11395.
This commit is contained in:
Unknown W. Brackets committed 2019-02-17 12:17:41 -08:00
1 parent 9e8341cf88
commit 6bc596d3a7
4 files changed
+17 -4

No files matched your search

+4
View File
@@ -29,6 +29,7 @@
#include "ui/view.h"
#include "ui/viewgroup.h"
#include "Core/Host.h"
#include "Core/HLE/sceCtrl.h"
#include "Core/System.h"
#include "Common/KeyMap.h"
@@ -79,6 +80,7 @@ void ControlMapper::Update() {
if (refresh_) {
refresh_ = false;
Refresh();
host->UpdateUI();
}
}
@@ -169,6 +171,7 @@ void ControlMapper::MappedCallback(KeyDef kdf) {
break;
case REPLACEONE:
KeyMap::g_controllerMap[pspKey_][actionIndex_] = kdf;
KeyMap::g_controllerMapGeneration++;
break;
default:
;
@@ -211,6 +214,7 @@ UI::EventReturn ControlMapper::OnAddMouse(UI::EventParams &params) {
UI::EventReturn ControlMapper::OnDelete(UI::EventParams &params) {
int index = atoi(params.v->Tag().c_str());
KeyMap::g_controllerMap[pspKey_].erase(KeyMap::g_controllerMap[pspKey_].begin() + index);
KeyMap::g_controllerMapGeneration++;
refresh_ = true;
return UI::EVENT_DONE;
}