Merge pull request #7962 from liusy182/disable-accelerator
disable accelerator when menu item is disabled
This commit is contained in:
commit
301b8ec39a
1 changed files with 5 additions and 4 deletions
|
@ -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];
|
||||||
|
if (item.model->IsEnabledAt(item.position)) {
|
||||||
item.model->ActivatedAt(item.position);
|
item.model->ActivatedAt(item.position);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace accelerator_util
|
} // namespace accelerator_util
|
||||||
|
|
Loading…
Reference in a new issue