]> git.lyx.org Git - features.git/commitdiff
Hide OptSubmenus (#9717)
authorGuillaume Munch <gm@lyx.org>
Thu, 17 Dec 2015 03:20:50 +0000 (03:20 +0000)
committerGuillaume Munch <gm@lyx.org>
Thu, 17 Dec 2015 21:54:41 +0000 (21:54 +0000)
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

src/frontends/qt4/Menus.cpp

index 7757b0d13ecfe8c6434d048323191d61c602038d..10761446d28f4d11bb561c9d39c8cfbc703ceb99 100644 (file)
@@ -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;
                                }