fix: enable property having no effect on submenus (#16835)
This commit is contained in:
parent
d16b581140
commit
1898f91620
1 changed files with 5 additions and 0 deletions
|
@ -246,6 +246,11 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
|
|||
[NSApp setServicesMenu:submenu];
|
||||
} else if (type == atom::AtomMenuModel::TYPE_SUBMENU &&
|
||||
model->IsVisibleAt(index)) {
|
||||
// We need to specifically check that the submenu top-level item has been
|
||||
// enabled as it's not validated by validateUserInterfaceItem
|
||||
if (!model->IsEnabledAt(index))
|
||||
[item setEnabled:NO];
|
||||
|
||||
// Recursively build a submenu from the sub-model at this index.
|
||||
[item setTarget:nil];
|
||||
[item setAction:nil];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue