2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
#include "widgets/basewidget.hpp"
|
2018-01-27 21:13:22 +01:00
|
|
|
#include "widgets/helper/label.hpp"
|
2017-11-12 17:21:50 +01:00
|
|
|
#include "widgets/helper/rippleeffectlabel.hpp"
|
|
|
|
#include "widgets/helper/signallabel.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>
|
2018-01-17 18:36:12 +01:00
|
|
|
#include <pajlada/settings/setting.hpp>
|
2018-04-11 01:06:13 +02:00
|
|
|
#include <pajlada/signals/connection.hpp>
|
|
|
|
|
|
|
|
#include <vector>
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
2017-06-26 16:41:20 +02:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
class Split;
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
class SplitHeader : public BaseWidget
|
2017-01-01 02:30:42 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-12 17:21:50 +01:00
|
|
|
explicit SplitHeader(Split *_chatWidget);
|
2018-05-26 16:31:43 +02:00
|
|
|
virtual ~SplitHeader() override;
|
2018-01-13 04:05:38 +01:00
|
|
|
|
2017-06-10 22:48:28 +02:00
|
|
|
// Update channel text from chat widget
|
2017-01-17 00:15:44 +01:00
|
|
|
void updateChannelText();
|
2018-01-17 16:52:51 +01:00
|
|
|
void updateModerationModeIcon();
|
2018-05-24 08:58:34 +02:00
|
|
|
void updateModes();
|
2017-01-01 02:30:42 +01:00
|
|
|
|
|
|
|
protected:
|
2018-01-25 21:11:14 +01:00
|
|
|
virtual void scaleChangedEvent(float) override;
|
|
|
|
virtual void themeRefreshEvent() override;
|
|
|
|
|
2017-06-10 22:48:28 +02:00
|
|
|
virtual void paintEvent(QPaintEvent *) override;
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
2018-05-16 14:55:45 +02:00
|
|
|
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
2017-06-10 22:48:28 +02:00
|
|
|
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
2018-05-26 16:31:43 +02:00
|
|
|
virtual void enterEvent(QEvent *) override;
|
2017-12-23 22:17:38 +01:00
|
|
|
virtual void leaveEvent(QEvent *event) override;
|
2017-06-10 22:48:28 +02:00
|
|
|
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
|
2017-01-01 02:30:42 +01:00
|
|
|
|
|
|
|
private:
|
2018-01-13 04:05:38 +01:00
|
|
|
Split *const split;
|
2017-01-16 18:27:51 +01:00
|
|
|
|
2017-06-11 09:11:55 +02:00
|
|
|
QPoint dragStart;
|
|
|
|
bool dragging = false;
|
2018-05-16 14:55:45 +02:00
|
|
|
bool doubleClicked = false;
|
|
|
|
bool showingHelpTooltip = false;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2018-04-03 02:55:32 +02:00
|
|
|
pajlada::Signals::Connection onlineStatusChangedConnection;
|
2017-11-04 14:57:29 +01:00
|
|
|
|
2018-01-17 16:52:51 +01:00
|
|
|
RippleEffectButton *dropdownButton;
|
2018-01-27 21:13:22 +01:00
|
|
|
// Label *titleLabel;
|
2018-05-26 16:31:43 +02:00
|
|
|
QLabel *titleLabel;
|
2018-05-24 08:58:34 +02:00
|
|
|
RippleEffectLabel *modeButton;
|
2018-01-17 16:52:51 +01:00
|
|
|
RippleEffectButton *moderationButton;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2018-01-13 04:05:38 +01:00
|
|
|
QMenu dropdownMenu;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
|
|
|
void rightButtonClicked();
|
|
|
|
|
2017-11-04 14:57:29 +01:00
|
|
|
void initializeChannelSignals();
|
|
|
|
|
2017-12-23 22:17:38 +01:00
|
|
|
QString tooltip;
|
|
|
|
bool isLive;
|
|
|
|
|
2018-04-11 01:06:13 +02:00
|
|
|
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
|
|
|
|
|
2017-06-10 23:53:39 +02:00
|
|
|
public slots:
|
2018-01-17 16:52:51 +01:00
|
|
|
void addDropdownItems(RippleEffectButton *label);
|
2018-01-13 04:05:38 +01:00
|
|
|
|
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
|