2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-01-20 06:10:28 +01:00
|
|
|
#include "widgets/signallabel.h"
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QPaintEvent>
|
|
|
|
#include <QWidget>
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-01-15 16:38:30 +01:00
|
|
|
class ChatWidgetHeaderButton : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-01-22 05:58:23 +01:00
|
|
|
explicit ChatWidgetHeaderButton(int spacing = 6);
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
SignalLabel &getLabel()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
2017-04-12 17:46:44 +02:00
|
|
|
return _label;
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void clicked();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
void enterEvent(QEvent *) Q_DECL_OVERRIDE;
|
|
|
|
void leaveEvent(QEvent *) Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
private:
|
2017-04-12 17:46:44 +02:00
|
|
|
QHBoxLayout _hbox;
|
|
|
|
SignalLabel _label;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
bool _mouseOver;
|
|
|
|
bool _mouseDown;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
void labelMouseUp();
|
|
|
|
void labelMouseDown();
|
|
|
|
};
|
|
|
|
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|