From 54a28ca2dce49511913a90fb7d51580e59ac966e Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Thu, 17 Dec 2015 22:26:50 +0000 Subject: [PATCH] Hide OptSubmenus (#9717) (for real this time) Amend 6cc69343 and d449e7e6. See the latter for the rationale behind this change. --- src/frontends/qt4/Menus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 10761446d2..ea32aace5b 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -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),