mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
GuiToolbar::fill(): only once.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24978 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
15b42ccd4a
commit
5254716219
@ -843,7 +843,7 @@ void GuiLayoutBox::selected(int index)
|
|||||||
GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
|
GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
|
||||||
: QToolBar(qt_(tbinfo.gui_name), &owner), visibility_(0),
|
: QToolBar(qt_(tbinfo.gui_name), &owner), visibility_(0),
|
||||||
allowauto_(false), owner_(owner), layout_(0), command_buffer_(0),
|
allowauto_(false), owner_(owner), layout_(0), command_buffer_(0),
|
||||||
tbinfo_(tbinfo)
|
tbinfo_(tbinfo), filled_(false)
|
||||||
{
|
{
|
||||||
// Toolbar dragging is allowed.
|
// Toolbar dragging is allowed.
|
||||||
setMovable(true);
|
setMovable(true);
|
||||||
@ -857,10 +857,13 @@ GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
|
|||||||
|
|
||||||
void GuiToolbar::fill()
|
void GuiToolbar::fill()
|
||||||
{
|
{
|
||||||
|
if (filled_)
|
||||||
|
return;
|
||||||
ToolbarInfo::item_iterator it = tbinfo_.items.begin();
|
ToolbarInfo::item_iterator it = tbinfo_.items.begin();
|
||||||
ToolbarInfo::item_iterator end = tbinfo_.items.end();
|
ToolbarInfo::item_iterator end = tbinfo_.items.end();
|
||||||
for (; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
add(*it);
|
add(*it);
|
||||||
|
filled_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -172,6 +172,8 @@ private:
|
|||||||
GuiCommandBuffer * command_buffer_;
|
GuiCommandBuffer * command_buffer_;
|
||||||
///
|
///
|
||||||
ToolbarInfo const & tbinfo_;
|
ToolbarInfo const & tbinfo_;
|
||||||
|
///
|
||||||
|
bool filled_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
Loading…
Reference in New Issue
Block a user