Move secondary toolbars to View->Toolbars->Other Toolbars.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25069 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-02 12:51:36 +00:00
parent de2d7197c9
commit cebd63f844
3 changed files with 21 additions and 2 deletions

View File

@ -1004,12 +1004,23 @@ void MenuDefinition::expandPasteRecent()
void MenuDefinition::expandToolbars()
{
MenuDefinition other_lists;
// extracts the toolbars from the backend
Toolbars::Infos::const_iterator cit = guiApp->toolbars().begin();
Toolbars::Infos::const_iterator end = guiApp->toolbars().end();
for (; cit != end; ++cit) {
add(MenuItem(MenuItem::Command, qt_(cit->gui_name),
FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name)));
MenuItem const item(MenuItem::Command, qt_(cit->gui_name),
FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name));
if (guiApp->toolbars().isMainToolbar(cit->name))
add(item);
else
other_lists.add(item);
}
if (!other_lists.empty()) {
MenuItem item(MenuItem::Submenu, qt_("Other Toolbars"));
item.setSubmenu(other_lists);
add(item);
}
}

View File

@ -323,5 +323,11 @@ int Toolbars::defaultVisibility(std::string const & name) const
}
bool Toolbars::isMainToolbar(std::string const & name) const
{
return toolbar_visibility_.find(name) != toolbar_visibility_.end();
}
} // namespace frontend
} // namespace lyx

View File

@ -131,6 +131,8 @@ public:
ToolbarInfo const * info(std::string const & name) const;
///
int defaultVisibility(std::string const & name) const;
///
bool isMainToolbar(std::string const & name) const;
private:
/// all the defined toolbars