2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-06-11 09:31:45 +02:00
|
|
|
#include "signallabel.hpp"
|
2017-06-26 16:41:20 +02:00
|
|
|
#include "widgets/basewidget.hpp"
|
2017-09-16 16:20:10 +02:00
|
|
|
#include "widgets/rippleeffectlabel.hpp"
|
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 {
|
2017-06-26 16:41:20 +02:00
|
|
|
|
|
|
|
class ColorScheme;
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace widgets {
|
2017-06-26 16:41:20 +02:00
|
|
|
|
2017-01-01 02:30:42 +01:00
|
|
|
class ChatWidget;
|
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
class ChatWidgetHeader : public BaseWidget
|
2017-01-01 02:30:42 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-06-10 22:48:28 +02:00
|
|
|
explicit ChatWidgetHeader(ChatWidget *_chatWidget);
|
|
|
|
// Update channel text from chat widget
|
2017-01-17 00:15:44 +01:00
|
|
|
void updateChannelText();
|
2017-09-11 22:37:39 +02:00
|
|
|
void checkLive();
|
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-09-22 00:50:43 +02:00
|
|
|
virtual void resizeEvent(QResizeEvent *event) override;
|
2017-01-01 02:30:42 +01:00
|
|
|
|
|
|
|
private:
|
2017-06-11 09:11:55 +02:00
|
|
|
ChatWidget *const chatWidget;
|
2017-01-16 18:27:51 +01:00
|
|
|
|
2017-06-11 09:11:55 +02:00
|
|
|
QPoint dragStart;
|
|
|
|
bool dragging = false;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-06-11 09:11:55 +02:00
|
|
|
QHBoxLayout hbox;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-06-11 09:11:55 +02:00
|
|
|
// top left
|
2017-09-16 16:20:10 +02:00
|
|
|
RippleEffectLabel leftLabel;
|
2017-06-11 09:11:55 +02:00
|
|
|
QMenu leftMenu;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-06-11 09:11:55 +02:00
|
|
|
// center
|
|
|
|
SignalLabel channelNameLabel;
|
|
|
|
|
|
|
|
// top right
|
2017-09-16 16:20:10 +02:00
|
|
|
RippleEffectLabel rightLabel;
|
2017-06-11 09:11:55 +02:00
|
|
|
QMenu rightMenu;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
void leftButtonClicked();
|
|
|
|
void rightButtonClicked();
|
|
|
|
|
2017-07-02 14:28:37 +02:00
|
|
|
virtual void refreshTheme() override;
|
|
|
|
|
2017-06-10 23:53:39 +02:00
|
|
|
public slots:
|
2017-01-15 16:38:30 +01:00
|
|
|
void menuMoveSplit();
|
|
|
|
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
|