mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
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:
parent
9a0570de4a
commit
4559120e8a
@ -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)));
|
||||
|
@ -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
|
||||
|
@ -48,9 +48,6 @@ public:
|
||||
IconPalette(QWidget * parent);
|
||||
void addButton(QAction *);
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateParent();
|
||||
|
||||
Q_SIGNALS:
|
||||
void triggered(QAction *);
|
||||
void visible(bool);
|
||||
|
Loading…
Reference in New Issue
Block a user