]> git.lyx.org Git - features.git/commitdiff
don't update parent and make sure the icon sizes on the palette are correct
authorEdwin Leuven <e.leuven@gmail.com>
Wed, 16 Jan 2008 20:51:00 +0000 (20:51 +0000)
committerEdwin Leuven <e.leuven@gmail.com>
Wed, 16 Jan 2008 20:51:00 +0000 (20:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22606 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/IconPalette.cpp
src/frontends/qt4/IconPalette.h

index 9bb1d33a79fe1c15ce0f7b6abbc06ea373acdde8..a6cb4d49722b84d238763106a8251e9919036556 100644 (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)));
index edc961f99f0560e365a2c5b74bed4636e1b4e28a..f156cca1c955f1cc9090d5e79b2a33418b501bbf 100644 (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
index 1e14fc13fb61bada0c8f691814ece5ef7d142c03..de16fb55e424345bd3cd2fc6af195e2bc61b25ad 100644 (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);