initialize iconpalettes only when the user asks for them

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22605 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2008-01-16 20:36:45 +00:00
parent 95fe0e16a7
commit 9a0570de4a

View File

@ -413,12 +413,17 @@ public:
setCheckable(true);
connect(this, SIGNAL(clicked(bool)), panel_, SLOT(setVisible(bool)));
connect(panel_, SIGNAL(visible(bool)), this, SLOT(setChecked(bool)));
ToolbarInfo const * tbinfo =
toolbarbackend.getDefinedToolbarInfo(tbitem_.name_);
if (tbinfo)
// use the icon of first action for the toolbar button
setIcon(getIcon(tbinfo->items.begin()->func_, true));
}
void showEvent(QShowEvent * e)
void mousePressEvent(QMouseEvent * e)
{
if (initialized_) {
QToolButton::showEvent(e);
QToolButton::mousePressEvent(e);
return;
}
@ -432,15 +437,11 @@ public:
}
ToolbarInfo::item_iterator it = tbinfo->items.begin();
ToolbarInfo::item_iterator const end = tbinfo->items.end();
for (; it != end; ++it) {
if (!getStatus(it->func_).unknown()) {
for (; it != end; ++it)
if (!getStatus(it->func_).unknown())
panel_->addButton(bar_->addItem(*it));
// use the icon of first action for the toolbar button
if (it == tbinfo->items.begin())
setIcon(getIcon(it->func_, true));
}
}
QToolButton::showEvent(e);
QToolButton::mousePressEvent(e);
}
};