summaryrefslogtreecommitdiffstats
path: root/include/gui/rollupwidget.h
blob: d34085c06a31678b984e30199e003c05d752d8fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef INCLUDE_ROLLUPWIDGET_H
#define INCLUDE_ROLLUPWIDGET_H

#include <QWidget>
#include "util/export.h"

class SDRANGELOVE_API RollupWidget : public QWidget {
	Q_OBJECT

public:
	RollupWidget(QWidget* parent = NULL);

	QByteArray saveState(int version = 0) const;
	bool restoreState(const QByteArray& state, int version = 0);

	void setTitleColor(const QColor& c);

signals:
	void widgetRolled(QWidget* widget, bool rollDown);
	void menuDoubleClickEvent();

protected:
	enum {
		VersionMarker = 0xff
	};

	QColor m_titleColor;

	int arrangeRollups();

	void paintEvent(QPaintEvent*);
	int paintRollup(QWidget* rollup, int pos, QPainter* p, bool last, const QColor& frame);

	void resizeEvent(QResizeEvent* size);
	void mousePressEvent(QMouseEvent* event);
	void mouseDoubleClickEvent(QMouseEvent* event);

	bool event(QEvent* event);
	bool eventFilter(QObject* object, QEvent* event);
};

#endif // INCLUDE_ROLLUPWIDGET_H