#ifndef EDOCKWIDGET_H
#define EDOCKWIDGET_H

#include <QDockWidget>
#include <QLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QIcon>
#include <QToolButton>
#include <QDebug>
#include "qad_export.h"


class QAD_EXPORT EDockWidget: public QDockWidget
{
	Q_OBJECT
public:
	explicit EDockWidget(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0): QDockWidget(title, parent, flags) {init();}
	explicit EDockWidget(QWidget * parent = 0, Qt::WindowFlags flags = 0): QDockWidget(parent, flags) {init();}
	~EDockWidget() {delete btn_hide; delete btn_dock; delete lbl_title; delete lbl_icon; delete header;}
	
	void setFeatures(QDockWidget::DockWidgetFeatures features);
	void setWindowTitle(const QString & title);
	void setWindowIcon(const QIcon & icon);
	
private:
	bool event(QEvent * e);
	void init();
	void updateStyle();
	
	QFrame * header;
	QLabel * lbl_title, * lbl_icon;
	QToolButton * btn_hide, * btn_dock;
	
private slots:
	void dockClicked() {setFloating(!isFloating());}
	
};

#endif // EDOCKWIDGET_H
