]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/IconPalette.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / IconPalette.h
index 1f0f37cd80b4548c5e7f6911f192e5bac1055c1a..de16fb55e424345bd3cd2fc6af195e2bc61b25ad 100644 (file)
 
 #include <QWidget>
 #include <QMenu>
-#include <QLayout>
-#include "Action.h"
+
+class QGridLayout;
 
 namespace lyx {
 namespace frontend {
 
+/**
+  * tear-off widget
+  */
+class TearOff : public QWidget {
+       Q_OBJECT
+public:
+       TearOff(QWidget * parent);
+       void enterEvent(QEvent *);
+       void leaveEvent(QEvent *);
+       void mouseReleaseEvent (QMouseEvent *);
+Q_SIGNALS:
+       void tearOff();
+protected:
+       void paintEvent(QPaintEvent *);
+private:
+       bool highlighted_;
+};
+
+
 /**
  * For holding an arbitrary set of icons.
  */
@@ -29,9 +48,6 @@ public:
        IconPalette(QWidget * parent);
        void addButton(QAction *);
 
-public Q_SLOTS:
-       void updateParent();
-
 Q_SIGNALS:
        void triggered(QAction *);
        void visible(bool);
@@ -42,13 +58,17 @@ protected:
        void paintEvent(QPaintEvent * event);
 
 private Q_SLOTS:
+       void tearOff();
        virtual void clicked(QAction *);
 
 private:
        QGridLayout * layout_;
        QList<QAction *> actions_;
+       bool tornoff_;
+       TearOff * tearoffwidget_; 
 };
 
+
 /**
  * Popup menu for a toolbutton.
  * We need this to keep track whether
@@ -58,7 +78,7 @@ private:
 class ButtonMenu : public QMenu {
        Q_OBJECT
 public:
-       ButtonMenu(const QString & title, QWidget * parent = 0 );
+       ButtonMenu(const QString & title, QWidget * parent);
        void add(QAction *);
 
 public Q_SLOTS: