don't update parent and make sure the icon sizes on the palette are correct

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22606 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2008-01-16 20:51:00 +00:00
parent 9a0570de4a
commit 4559120e8a
3 changed files with 2 additions and 25 deletions

View File

@ -409,7 +409,6 @@ public:
this, SLOT(setIconSize(QSize)));
panel_ = new IconPalette(this);
panel_->setWindowTitle(qt_(to_ascii(tbitem_.label_)));
connect(bar_, SIGNAL(updated()), panel_, SLOT(updateParent()));
setCheckable(true);
connect(this, SIGNAL(clicked(bool)), panel_, SLOT(setVisible(bool)));
connect(panel_, SIGNAL(visible(bool)), this, SLOT(setChecked(bool)));

View File

@ -111,6 +111,8 @@ void IconPalette::addButton(QAction * action)
QToolButton * tb = new QToolButton;
tb->setAutoRaise(true);
tb->setDefaultAction(action);
QToolButton * pb = qobject_cast<QToolButton *>(parentWidget());
tb->setIconSize(pb->iconSize());
// trigger tooltip (children of popups do not receive mousemove events)
tb->setMouseTracking(true);
@ -204,27 +206,6 @@ void IconPalette::hideEvent(QHideEvent * event )
}
void IconPalette::updateParent()
{
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)
if (actions_.at(i)->isEnabled()) {
enable = true;
break;
}
#else
// we check only the first action to enable/disable the menu
if (!actions_.isEmpty())
enable = actions_.at(0)->isEnabled();
#endif
parentWidget()->setEnabled(enable);
}
void IconPalette::paintEvent(QPaintEvent * /*event*/)
{
// draw border

View File

@ -48,9 +48,6 @@ public:
IconPalette(QWidget * parent);
void addButton(QAction *);
public Q_SLOTS:
void updateParent();
Q_SIGNALS:
void triggered(QAction *);
void visible(bool);