mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
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:
parent
95fe0e16a7
commit
9a0570de4a
@ -413,12 +413,17 @@ public:
|
|||||||
setCheckable(true);
|
setCheckable(true);
|
||||||
connect(this, SIGNAL(clicked(bool)), panel_, SLOT(setVisible(bool)));
|
connect(this, SIGNAL(clicked(bool)), panel_, SLOT(setVisible(bool)));
|
||||||
connect(panel_, SIGNAL(visible(bool)), this, SLOT(setChecked(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_) {
|
if (initialized_) {
|
||||||
QToolButton::showEvent(e);
|
QToolButton::mousePressEvent(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,15 +437,11 @@ public:
|
|||||||
}
|
}
|
||||||
ToolbarInfo::item_iterator it = tbinfo->items.begin();
|
ToolbarInfo::item_iterator it = tbinfo->items.begin();
|
||||||
ToolbarInfo::item_iterator const end = tbinfo->items.end();
|
ToolbarInfo::item_iterator const end = tbinfo->items.end();
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it)
|
||||||
if (!getStatus(it->func_).unknown()) {
|
if (!getStatus(it->func_).unknown())
|
||||||
panel_->addButton(bar_->addItem(*it));
|
panel_->addButton(bar_->addItem(*it));
|
||||||
// use the icon of first action for the toolbar button
|
|
||||||
if (it == tbinfo->items.begin())
|
QToolButton::mousePressEvent(e);
|
||||||
setIcon(getIcon(it->func_, true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QToolButton::showEvent(e);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user