2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2016-12-30 12:19:31 +01:00
|
|
|
|
2018-08-08 15:35:54 +02:00
|
|
|
#include "Button.hpp"
|
2017-04-12 17:46:44 +02:00
|
|
|
|
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 {
|
|
|
|
|
2018-07-05 13:25:10 +02:00
|
|
|
class Notebook;
|
|
|
|
|
2018-08-08 15:35:54 +02:00
|
|
|
class NotebookButton : public Button
|
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:
|
2018-07-05 13:25:10 +02:00
|
|
|
enum Icon { None, Plus, User, Settings };
|
2016-12-30 12:20:26 +01:00
|
|
|
|
2018-07-05 13:25:10 +02:00
|
|
|
explicit NotebookButton(Notebook *parent);
|
2016-12-30 12:20:26 +01:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
void setIcon(Icon icon);
|
2018-07-05 13:25:10 +02:00
|
|
|
Icon getIcon() const;
|
2016-12-30 12:20:26 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
protected:
|
2018-07-06 17:11:37 +02:00
|
|
|
virtual void themeChangedEvent() override;
|
2018-01-24 22:09:26 +01:00
|
|
|
virtual void paintEvent(QPaintEvent *) override;
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent *) override;
|
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *) override;
|
|
|
|
virtual void dragLeaveEvent(QDragLeaveEvent *) override;
|
|
|
|
virtual void dropEvent(QDropEvent *) override;
|
2016-12-30 12:20:26 +01:00
|
|
|
|
2018-07-05 13:25:10 +02:00
|
|
|
virtual void hideEvent(QHideEvent *) override;
|
|
|
|
virtual void showEvent(QShowEvent *) override;
|
|
|
|
|
2017-01-01 18:43:52 +01:00
|
|
|
signals:
|
|
|
|
void clicked();
|
|
|
|
|
2016-12-30 12:20:26 +01:00
|
|
|
private:
|
2018-07-05 13:25:10 +02:00
|
|
|
Notebook *parent_ = nullptr;
|
2018-06-06 10:46:23 +02:00
|
|
|
QPoint mousePos_;
|
2018-07-05 13:25:10 +02:00
|
|
|
Icon icon_ = None;
|
2016-12-30 12:19:31 +01:00
|
|
|
};
|
2017-05-27 15:40:06 +02:00
|
|
|
|
2017-04-14 17:47:28 +02:00
|
|
|
} // namespace chatterino
|