mirror-chatterino2/widgets/chatwidgetheaderbutton.h

53 lines
954 B
C
Raw Normal View History

2017-01-15 16:38:30 +01:00
#ifndef CHATWIDGETHEADERBUTTON_H
#define CHATWIDGETHEADERBUTTON_H
2017-01-18 21:30:23 +01:00
#include "widgets/chatwidgetheaderbuttonlabel.h"
2017-01-15 16:38:30 +01:00
#include <QHBoxLayout>
#include <QLabel>
#include <QPaintEvent>
#include <QWidget>
2017-01-18 21:30:23 +01:00
namespace chatterino {
namespace widgets {
2017-01-15 16:38:30 +01:00
class ChatWidgetHeaderButton : public QWidget
{
Q_OBJECT
public:
ChatWidgetHeaderButton();
ChatWidgetHeaderButtonLabel &
2017-01-18 04:33:30 +01:00
getLabel()
2017-01-15 16:38:30 +01:00
{
2017-01-18 04:33:30 +01: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:
QHBoxLayout hbox;
2017-01-18 04:33:30 +01:00
ChatWidgetHeaderButtonLabel label;
2017-01-15 16:38:30 +01:00
2017-01-18 04:33:30 +01:00
bool mouseOver;
bool mouseDown;
2017-01-15 16:38:30 +01:00
void labelMouseUp();
void labelMouseDown();
};
2017-01-18 21:30:23 +01:00
}
}
2017-01-15 16:38:30 +01:00
#endif // CHATWIDGETHEADERBUTTON_H