2017-09-30 00:20:12 +00:00
|
|
|
#ifndef QTMATERIALDRAWER_H
|
|
|
|
#define QTMATERIALDRAWER_H
|
|
|
|
|
|
|
|
#include "lib/qtmaterialoverlaywidget.h"
|
|
|
|
|
|
|
|
class QtMaterialDrawerPrivate;
|
|
|
|
class QtMaterialDrawerStateMachine;
|
|
|
|
|
|
|
|
class QtMaterialDrawer : public QtMaterialOverlayWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit QtMaterialDrawer(QWidget *parent = 0);
|
|
|
|
~QtMaterialDrawer();
|
|
|
|
|
|
|
|
void setDrawerWidth(int width);
|
|
|
|
int drawerWidth() const;
|
|
|
|
|
|
|
|
void setDrawerLayout(QLayout *layout);
|
|
|
|
QLayout *drawerLayout() const;
|
|
|
|
|
2017-10-03 07:08:46 +00:00
|
|
|
void setClickOutsideToClose(bool state);
|
|
|
|
bool clickOutsideToClose() const;
|
|
|
|
|
2017-10-05 08:13:21 +00:00
|
|
|
void setAutoRaise(bool state);
|
|
|
|
bool autoRaise() const;
|
|
|
|
|
2017-10-07 12:54:56 +00:00
|
|
|
void setOverlayMode(bool value);
|
|
|
|
bool overlayMode() const;
|
|
|
|
|
2017-09-30 10:07:05 +00:00
|
|
|
public slots:
|
2017-09-30 00:20:12 +00:00
|
|
|
void openDrawer();
|
|
|
|
void closeDrawer();
|
|
|
|
|
|
|
|
protected:
|
2017-10-12 19:10:43 +00:00
|
|
|
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
2017-09-30 00:20:12 +00:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
const QScopedPointer<QtMaterialDrawerPrivate> d_ptr;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(QtMaterialDrawer)
|
|
|
|
Q_DECLARE_PRIVATE(QtMaterialDrawer)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QTMATERIALDRAWER_H
|