]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/IconPalette.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / IconPalette.cpp
index 2593882e826da0a2648a8fc696d9e65f0070c4c5..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,19 +206,6 @@ void IconPalette::hideEvent(QHideEvent * event )
 }
 
 
-void IconPalette::updateParent()
-{
-       bool enable = false;
-       for (int i = 0; i < actions_.size(); ++i)
-               if (actions_.at(i)->isEnabled()) {
-                       enable = true;
-                       break;
-               }
-
-       parentWidget()->setEnabled(enable);
-}
-
-
 void IconPalette::paintEvent(QPaintEvent * /*event*/)
 {
        // draw border
@@ -256,11 +245,19 @@ void ButtonMenu::add(QAction * action)
 void ButtonMenu::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);
 }