mirror-chatterino2/src/widgets/helper/NotebookButton.hpp

44 lines
931 B
C++
Raw Normal View History

#pragma once
2016-12-30 12:19:31 +01:00
2018-06-26 14:09:39 +02:00
#include "RippleEffectButton.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 {
class Notebook;
class NotebookButton : public RippleEffectButton
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:
enum Icon { None, Plus, User, Settings };
2016-12-30 12:20:26 +01:00
explicit NotebookButton(Notebook *parent);
2016-12-30 12:20:26 +01:00
void setIcon(Icon icon_);
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
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:
Notebook *parent_ = nullptr;
2018-06-06 10:46:23 +02:00
QPoint mousePos_;
Icon icon_ = None;
2016-12-30 12:19:31 +01:00
};
2017-04-14 17:47:28 +02:00
} // namespace chatterino