]> git.lyx.org Git - features.git/commitdiff
Hide OptSubmenus (#9717) (for real this time)
authorGuillaume Munch <gm@lyx.org>
Thu, 17 Dec 2015 22:26:50 +0000 (22:26 +0000)
committerGuillaume Munch <gm@lyx.org>
Thu, 17 Dec 2015 23:48:47 +0000 (23:48 +0000)
Amend 6cc69343 and d449e7e6. See the latter for the rationale behind this
change.

src/frontends/qt4/Menus.cpp

index 10761446d28f4d11bb561c9d39c8cfbc703ceb99..ea32aace5b7af5f28f3e480ff5eba460437534e4 100644 (file)
@@ -419,7 +419,7 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i)
                                if ((cit->kind() == MenuItem::Command
                                     || cit->kind() == MenuItem::Submenu
                                     || cit->kind() == MenuItem::Help)
-                                   && (!i.optional() || cit->status().enabled())) {
+                                   && cit->status().enabled()) {
                                        enabled = true;
                                        break;
                                }
@@ -1771,7 +1771,7 @@ void Menu::Impl::populate(QMenu & qMenu, MenuDefinition const & menu)
                else if (m->kind() == MenuItem::Submenu) {
                        QMenu * subMenu = qMenu.addMenu(label(*m));
                        populate(*subMenu, m->submenu());
-                       subMenu->setEnabled(m->status().enabled());
+                       subMenu->setEnabled(!subMenu->isEmpty());
                } else {
                        // we have a MenuItem::Command
                        qMenu.addAction(new Action(QIcon(), label(*m),