Accelerator actions: update state before run and run only if enabled.

This commit is contained in:
and3md 2017-09-21 19:14:07 +02:00
parent e067acf788
commit b4330ab776
1 changed files with 7 additions and 1 deletions

View File

@ -1189,7 +1189,13 @@ public:
Action action = findKeyAction(event.keyCode, event.flags); // & (KeyFlag.Shift | KeyFlag.Alt | KeyFlag.Control | KeyFlag.Menu)
if (action !is null) {
//Log.d("Action found: ", action.id, " ", action.labelValue.id);
return dispatchAction(action);
// update action state
if (updateActionState(action, true) && action is _action)
handleActionStateChanged();
//run only enabled actions
if (action.state.enabled)
return dispatchAction(action);
}
}
// handle focus navigation using keys