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)));
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);
}
-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