mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
* make sure the Mac special menu item are only created once per QMenuBar.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23754 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a8455831f0
commit
f9f0b26bd3
@ -746,7 +746,7 @@ bool GuiApplication::searchMenu(FuncRequest const & func,
|
||||
void GuiApplication::initGlobalMenu()
|
||||
{
|
||||
if (global_menubar_)
|
||||
menus().fillMenuBar(global_menubar_, 0);
|
||||
menus().fillMenuBar(global_menubar_, 0, true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -283,7 +283,7 @@ GuiView::GuiView(int id)
|
||||
theLyXFunc().setLyXView(this);
|
||||
|
||||
// Fill up the menu bar.
|
||||
guiApp->menus().fillMenuBar(menuBar(), this);
|
||||
guiApp->menus().fillMenuBar(menuBar(), this, true);
|
||||
|
||||
setCentralWidget(d.stack_widget_);
|
||||
|
||||
|
@ -1461,15 +1461,17 @@ bool Menus::searchMenu(FuncRequest const & func,
|
||||
}
|
||||
|
||||
|
||||
void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view)
|
||||
void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
|
||||
{
|
||||
// Clear all menubar contents before filling it.
|
||||
qmb->clear();
|
||||
|
||||
if (initial) {
|
||||
#ifdef Q_WS_MACX
|
||||
// setup special mac specific menu item
|
||||
d->macxMenuBarInit(view, qmb);
|
||||
// setup special mac specific menu item
|
||||
d->macxMenuBarInit(view, qmb);
|
||||
#endif
|
||||
} else {
|
||||
// Clear all menubar contents before filling it.
|
||||
qmb->clear();
|
||||
}
|
||||
|
||||
LYXERR(Debug::GUI, "populating menu bar" << fromqstr(d->menubar_.name()));
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
bool searchMenu(FuncRequest const & func,
|
||||
std::vector<docstring> & names) const;
|
||||
///
|
||||
void fillMenuBar(QMenuBar * qmb, GuiView * view);
|
||||
void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
|
||||
|
||||
/// \return a top-level submenu given its name.
|
||||
Menu * menu(QString const & name, GuiView & view);
|
||||
|
Loading…
Reference in New Issue
Block a user