mirror-chatterino2/widgets/notebookbutton.h

41 lines
691 B
C
Raw Normal View History

2016-12-30 12:19:31 +01:00
#ifndef NOTEBOOKBUTTON_H
#define NOTEBOOKBUTTON_H
2017-04-12 17:46:44 +02:00
#include "fancybutton.h"
2016-12-30 12:20:26 +01:00
#include <QWidget>
2016-12-30 12:19:31 +01:00
2017-01-18 21:30:23 +01:00
namespace chatterino {
namespace widgets {
2017-04-12 17:46:44 +02:00
class NotebookButton : public FancyButton
2016-12-30 12:19:31 +01:00
{
2016-12-30 12:20:26 +01:00
Q_OBJECT
2017-04-12 17:46:44 +02:00
2016-12-30 12:19:31 +01:00
public:
2016-12-30 12:20:26 +01:00
static const int IconPlus = 0;
2017-01-01 02:30:42 +01:00
static const int IconUser = 1;
static const int IconSettings = 2;
2016-12-30 12:20:26 +01:00
int icon = 0;
NotebookButton(QWidget *parent);
2017-04-12 17:46:44 +02:00
protected:
void paintEvent(QPaintEvent *) override;
void mouseReleaseEvent(QMouseEvent *event) override;
2016-12-30 12:20:26 +01:00
2017-01-01 18:43:52 +01:00
signals:
void clicked();
2016-12-30 12:20:26 +01:00
private:
2017-04-12 17:46:44 +02:00
bool _mouseOver = false;
bool _mouseDown = false;
QPoint _mousePos;
2016-12-30 12:19:31 +01:00
};
2017-04-14 17:47:28 +02:00
} // namespace widgets
} // namespace chatterino
2016-12-30 12:19:31 +01:00
2017-01-11 18:52:09 +01:00
#endif // NOTEBOOKBUTTON_H