mirror-chatterino2/src/widgets/notebookbutton.h

38 lines
625 B
C
Raw Normal View History

#pragma once
2016-12-30 12:19:31 +01:00
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