From: Guillaume Munch Date: Thu, 17 Dec 2015 03:20:50 +0000 (+0000) Subject: Hide OptSubmenus (#9717) X-Git-Tag: 2.2.0beta1~349 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6cc69343;p=features.git 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 --- diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 7757b0d13e..10761446d2 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -417,8 +417,9 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i) cit != i.submenu().end(); ++cit) { // 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::Submenu + || cit->kind() == MenuItem::Help) + && (!i.optional() || cit->status().enabled())) { enabled = true; break; }