2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-01-18 14:48:42 +01:00
|
|
|
#include "signallabel.h"
|
2017-01-18 21:30:23 +01:00
|
|
|
#include "widgets/chatwidgetheaderbutton.h"
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QMouseEvent>
|
|
|
|
#include <QPaintEvent>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QWidget>
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
2017-01-01 02:30:42 +01:00
|
|
|
class ChatWidget;
|
|
|
|
|
|
|
|
class ChatWidgetHeader : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-06-10 22:48:28 +02:00
|
|
|
explicit ChatWidgetHeader(ChatWidget *_chatWidget);
|
2017-01-16 18:27:51 +01:00
|
|
|
|
2017-06-10 22:48:28 +02:00
|
|
|
// Update palette from global color scheme
|
2017-01-15 16:38:30 +01:00
|
|
|
void updateColors();
|
2017-06-10 22:48:28 +02:00
|
|
|
|
|
|
|
// Update channel text from chat widget
|
2017-01-17 00:15:44 +01:00
|
|
|
void updateChannelText();
|
2017-01-01 02:30:42 +01:00
|
|
|
|
|
|
|
protected:
|
2017-06-10 22:48:28 +02:00
|
|
|
virtual void paintEvent(QPaintEvent *) override;
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
|
|
|
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
|
2017-01-01 02:30:42 +01:00
|
|
|
|
|
|
|
private:
|
2017-06-10 22:48:28 +02:00
|
|
|
ChatWidget *chatWidget;
|
2017-01-16 18:27:51 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
QPoint _dragStart;
|
|
|
|
bool _dragging;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
QHBoxLayout _hbox;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
ChatWidgetHeaderButton _leftLabel;
|
|
|
|
SignalLabel _middleLabel;
|
|
|
|
ChatWidgetHeaderButton _rightLabel;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
QMenu _leftMenu;
|
|
|
|
QMenu _rightMenu;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
void leftButtonClicked();
|
|
|
|
void rightButtonClicked();
|
|
|
|
|
2017-06-10 23:53:39 +02:00
|
|
|
public slots:
|
2017-01-15 16:38:30 +01:00
|
|
|
void menuMoveSplit();
|
2017-02-03 19:31:51 +01:00
|
|
|
void menuPopup();
|
2017-01-15 16:38:30 +01:00
|
|
|
void menuClearChat();
|
|
|
|
void menuOpenChannel();
|
|
|
|
void menuPopupPlayer();
|
|
|
|
void menuReloadChannelEmotes();
|
|
|
|
void menuManualReconnect();
|
|
|
|
void menuShowChangelog();
|
2017-01-01 02:30:42 +01:00
|
|
|
};
|
|
|
|
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|