mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
52 lines
930 B
C++
52 lines
930 B
C++
#ifndef CHATWIDGETHEADERBUTTON_H
|
|
#define CHATWIDGETHEADERBUTTON_H
|
|
|
|
#include "widgets/signallabel.h"
|
|
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
#include <QPaintEvent>
|
|
#include <QWidget>
|
|
|
|
namespace chatterino {
|
|
namespace widgets {
|
|
|
|
class ChatWidgetHeaderButton : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ChatWidgetHeaderButton(int spacing = 6);
|
|
|
|
SignalLabel &
|
|
getLabel()
|
|
{
|
|
return label;
|
|
}
|
|
|
|
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:
|
|
QHBoxLayout hbox;
|
|
SignalLabel label;
|
|
|
|
bool mouseOver;
|
|
bool mouseDown;
|
|
|
|
void labelMouseUp();
|
|
void labelMouseDown();
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif // CHATWIDGETHEADERBUTTON_H
|