mirror-chatterino2/src/widgets/chatwidgetheaderbutton.hpp
Rasmus Karlsson 7df7da70cb A lot of changes
Remove unused constructor of messages::Message
Fixed LimitedQueueSnapshot _-prefixes
Changed LimitedQueueSnapshot's usage of int to std::size_t
ColorScheme is no longer a singleton
Created a "BaseWidget" class which is pretty much a QWidget except it
has a reference of ColorScheme since most widgets will need a reference
to the style they should use.
BaseWidget can be implemented either with a BaseWidget parent (which
will copy the ColorScheme reference from the parent) or with a
normal QWidget parent and an explicit ColorScheme reference.
Save main window geometry on close
Fix font changing in the Settings Dialog
Update settings library version
2017-06-26 19:53:31 +02:00

58 lines
1 KiB
C++

#pragma once
#include "widgets/basewidget.hpp"
#include "widgets/signallabel.hpp"
#include <QHBoxLayout>
#include <QLabel>
#include <QPaintEvent>
#include <QWidget>
namespace chatterino {
class ColorScheme;
namespace widgets {
class ChatWidgetHeader;
class ChatWidgetHeaderButton : public BaseWidget
{
Q_OBJECT
public:
explicit ChatWidgetHeaderButton(BaseWidget *parent, int spacing = 6);
SignalLabel &getLabel()
{
return this->ui.label;
}
signals:
void clicked();
protected:
virtual void paintEvent(QPaintEvent *) override;
virtual void enterEvent(QEvent *) override;
virtual void leaveEvent(QEvent *) override;
virtual void mousePressEvent(QMouseEvent *event) override;
virtual void mouseReleaseEvent(QMouseEvent *event) override;
private:
struct {
QHBoxLayout hbox;
SignalLabel label;
} ui;
bool mouseOver = false;
bool mouseDown = false;
void labelMouseUp();
void labelMouseDown();
};
} // namespace widgets
} // namespace chatterino