Hide OptSubmenus (#9717)

At d449e7e6 it has been decided that submenus are going to be displayed even if
all their items are disabled. Here we make an exception for OptSubmenus.

Example of submenu no longer shown: Insert > Insert Regexp
Example of submenu always shown: Edit > Math > Limit Type, Macro Definition
This commit is contained in:
Guillaume Munch 2015-12-17 03:20:50 +00:00
parent dc016de34e
commit 6cc6934378

View File

@ -418,7 +418,8 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i)
// Only these kind of items affect the status of the submenu
if ((cit->kind() == MenuItem::Command
|| cit->kind() == MenuItem::Submenu
|| cit->kind() == MenuItem::Help)) {
|| cit->kind() == MenuItem::Help)
&& (!i.optional() || cit->status().enabled())) {
enabled = true;
break;
}