2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
#include "widgets/basewidget.hpp"
|
2017-06-11 09:31:45 +02:00
|
|
|
#include "widgets/signallabel.hpp"
|
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 {
|
2017-06-26 16:41:20 +02:00
|
|
|
|
|
|
|
class ColorScheme;
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace widgets {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
class ChatWidgetHeader;
|
|
|
|
|
|
|
|
class ChatWidgetHeaderButton : public BaseWidget
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-06-26 16:41:20 +02:00
|
|
|
explicit ChatWidgetHeaderButton(BaseWidget *parent, 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-06-26 16:41:20 +02:00
|
|
|
return this->ui.label;
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void clicked();
|
|
|
|
|
|
|
|
protected:
|
2017-06-26 16:41:20 +02:00
|
|
|
virtual void paintEvent(QPaintEvent *) override;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
virtual void enterEvent(QEvent *) override;
|
|
|
|
virtual void leaveEvent(QEvent *) override;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
private:
|
2017-06-26 16:41:20 +02:00
|
|
|
struct {
|
|
|
|
QHBoxLayout hbox;
|
|
|
|
SignalLabel label;
|
|
|
|
} ui;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
bool mouseOver = false;
|
|
|
|
bool mouseDown = false;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
void labelMouseUp();
|
|
|
|
void labelMouseDown();
|
|
|
|
};
|
|
|
|
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|