disable accelerator when menu item is disabled

This commit is contained in:
liusi 2016-11-14 12:29:27 +08:00
parent 7971ce0dd9
commit 06cfcd612d

View file

@ -90,11 +90,12 @@ bool TriggerAcceleratorTableCommand(AcceleratorTable* table,
const ui::Accelerator& accelerator) { const ui::Accelerator& accelerator) {
if (ContainsKey(*table, accelerator)) { if (ContainsKey(*table, accelerator)) {
const accelerator_util::MenuItem& item = (*table)[accelerator]; const accelerator_util::MenuItem& item = (*table)[accelerator];
item.model->ActivatedAt(item.position); if (item.model->IsEnabledAt(item.position)) {
return true; item.model->ActivatedAt(item.position);
} else { return true;
return false; }
} }
return false;
} }
} // namespace accelerator_util } // namespace accelerator_util