00001 #ifndef COLLAPSEABLEWIDGET_H
00002 #define COLLAPSEABLEWIDGET_H
00003
00004 #include <QWidget>
00005 #include <QLayout>
00006 #include <QLabel>
00007 #include <QToolButton>
00008 #include <QCheckBox>
00009 #include <QResizeEvent>
00010
00011 class CollapseableWidget : public QWidget
00012 {
00013 Q_OBJECT
00014
00015 Q_PROPERTY(QString title READ getTitle WRITE setTitle)
00016
00017 public:
00018 CollapseableWidget(QWidget* parent=0);
00019 ~CollapseableWidget();
00020
00021 QSize minimumSizeHint() const;
00022
00023 QString getTitle() const;
00024 void setTitle(const QString &title);
00025
00026 public slots:
00027
00028 private slots:
00029 void toggleCollapsed();
00030 void setOpacity(int);
00031
00032 signals:
00033 void opacityChanged(float);
00034 void toggled(bool);
00035
00036 protected:
00037 void resizeEvent(QResizeEvent *event);
00038
00039 private:
00040 QFrame *menu;
00041 QCheckBox *activateCheckBox;
00042 QLabel *opacityValueLabel;
00043 QToolButton *collapseButton;
00044
00045 int menuHeight, lastMaximumHeight;
00046 bool collapsed;
00047 };
00048
00049 #endif // COLLAPSEABLEWIDGET_H