From 4559120e8a0c65fa70eae951e5202d2e14ba5c02 Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Wed, 16 Jan 2008 20:51:00 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiToolbar.cpp | 1 - src/frontends/qt4/IconPalette.cpp | 23 ++--------------------- src/frontends/qt4/IconPalette.h | 3 --- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index 9bb1d33a79..a6cb4d4972 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -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))); diff --git a/src/frontends/qt4/IconPalette.cpp b/src/frontends/qt4/IconPalette.cpp index edc961f99f..f156cca1c9 100644 --- a/src/frontends/qt4/IconPalette.cpp +++ b/src/frontends/qt4/IconPalette.cpp @@ -111,6 +111,8 @@ void IconPalette::addButton(QAction * action) QToolButton * tb = new QToolButton; tb->setAutoRaise(true); tb->setDefaultAction(action); + QToolButton * pb = qobject_cast(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 diff --git a/src/frontends/qt4/IconPalette.h b/src/frontends/qt4/IconPalette.h index 1e14fc13fb..de16fb55e4 100644 --- a/src/frontends/qt4/IconPalette.h +++ b/src/frontends/qt4/IconPalette.h @@ -48,9 +48,6 @@ public: IconPalette(QWidget * parent); void addButton(QAction *); -public Q_SLOTS: - void updateParent(); - Q_SIGNALS: void triggered(QAction *); void visible(bool); -- 2.39.2