mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-24 01:01:57 +00:00
avoid costly updating
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20637 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c56fa287b6
commit
cdff3df5d1
@ -207,11 +207,19 @@ void IconPalette::hideEvent(QHideEvent * event )
|
|||||||
void IconPalette::updateParent()
|
void IconPalette::updateParent()
|
||||||
{
|
{
|
||||||
bool enable = false;
|
bool enable = false;
|
||||||
|
// FIXME: so this is commented out for speed considerations
|
||||||
|
// true fix is to repair the updating mechanism of the toolbar
|
||||||
|
#if 0
|
||||||
for (int i = 0; i < actions_.size(); ++i)
|
for (int i = 0; i < actions_.size(); ++i)
|
||||||
if (actions_.at(i)->isEnabled()) {
|
if (actions_.at(i)->isEnabled()) {
|
||||||
enable = true;
|
enable = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// we check only the first action to enable/disable the menu
|
||||||
|
if (actions_.size() > 0)
|
||||||
|
enable = actions_.at(0)->isEnabled();
|
||||||
|
#endif
|
||||||
|
|
||||||
parentWidget()->setEnabled(enable);
|
parentWidget()->setEnabled(enable);
|
||||||
}
|
}
|
||||||
@ -256,11 +264,19 @@ void ButtonMenu::add(QAction * action)
|
|||||||
void ButtonMenu::updateParent()
|
void ButtonMenu::updateParent()
|
||||||
{
|
{
|
||||||
bool enable = false;
|
bool enable = false;
|
||||||
|
// FIXME: so this is commented out for speed considerations
|
||||||
|
// true fix is to repair the updating mechanism of the toolbar
|
||||||
|
#if 0
|
||||||
for (int i = 0; i < actions_.size(); ++i)
|
for (int i = 0; i < actions_.size(); ++i)
|
||||||
if (actions_.at(i)->isEnabled()) {
|
if (actions_.at(i)->isEnabled()) {
|
||||||
enable = true;
|
enable = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// we check only the first action to enable/disable the menu
|
||||||
|
if (actions_.size() > 0)
|
||||||
|
enable = actions_.at(0)->isEnabled();
|
||||||
|
#endif
|
||||||
|
|
||||||
parentWidget()->setEnabled(enable);
|
parentWidget()->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user