2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-09-16 00:05:06 +02:00
|
|
|
#include "emotemanager.hpp"
|
2017-06-11 09:31:45 +02:00
|
|
|
#include "resizingtextedit.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"
|
|
|
|
#include "widgets/emotepopup.hpp"
|
2017-01-21 05:14:27 +01:00
|
|
|
|
|
|
|
#include <QHBoxLayout>
|
2017-01-22 05:58:23 +01:00
|
|
|
#include <QLabel>
|
2017-01-21 05:14:27 +01:00
|
|
|
#include <QLineEdit>
|
2017-01-18 04:52:47 +01:00
|
|
|
#include <QPaintEvent>
|
2017-01-20 06:10:28 +01:00
|
|
|
#include <QTextEdit>
|
2017-01-21 05:14:27 +01:00
|
|
|
#include <QVBoxLayout>
|
2017-01-18 04:52:47 +01:00
|
|
|
#include <QWidget>
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-09-15 17:23:49 +02:00
|
|
|
#include <boost/signals2.hpp>
|
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
|
|
|
|
2017-01-29 13:23:22 +01:00
|
|
|
class ChatWidget;
|
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
class ChatWidgetInput : public BaseWidget
|
2017-01-01 02:30:42 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-09-16 00:05:06 +02:00
|
|
|
ChatWidgetInput(ChatWidget *_chatWidget, EmoteManager &);
|
2017-01-22 12:46:35 +01:00
|
|
|
~ChatWidgetInput();
|
2017-01-01 02:30:42 +01:00
|
|
|
|
|
|
|
protected:
|
2017-06-11 11:36:42 +02:00
|
|
|
virtual void paintEvent(QPaintEvent *) override;
|
|
|
|
virtual void resizeEvent(QResizeEvent *) override;
|
2017-01-22 05:58:23 +01:00
|
|
|
|
2017-07-31 01:26:20 +02:00
|
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
|
2017-01-20 06:10:28 +01:00
|
|
|
private:
|
2017-06-11 20:53:43 +02:00
|
|
|
ChatWidget *const chatWidget;
|
2017-09-15 17:23:49 +02:00
|
|
|
EmotePopup *emotePopup = nullptr;
|
2017-09-16 00:05:06 +02:00
|
|
|
EmoteManager &emoteManager;
|
2017-01-29 13:23:22 +01:00
|
|
|
|
2017-09-15 17:23:49 +02:00
|
|
|
boost::signals2::connection textLengthVisibleChangedConnection;
|
2017-06-11 11:36:42 +02:00
|
|
|
QHBoxLayout hbox;
|
|
|
|
QVBoxLayout vbox;
|
|
|
|
QHBoxLayout editContainer;
|
|
|
|
ResizingTextEdit textInput;
|
|
|
|
QLabel textLengthLabel;
|
2017-09-16 16:20:10 +02:00
|
|
|
RippleEffectLabel emotesLabel;
|
2017-07-24 13:48:34 +02:00
|
|
|
QStringList prevMsg;
|
|
|
|
unsigned int prevIndex = 0;
|
2017-07-02 14:28:37 +02:00
|
|
|
virtual void refreshTheme() override;
|
|
|
|
|
2017-01-22 05:58:23 +01:00
|
|
|
private slots:
|
2017-01-29 13:23:22 +01:00
|
|
|
void editTextChanged();
|
|
|
|
// void editKeyPressed(QKeyEvent *event);
|
2017-06-11 20:53:43 +02:00
|
|
|
|
|
|
|
friend class ChatWidget;
|
2017-01-01 02:30:42 +01:00
|
|
|
};
|
2017-06-07 10:09:24 +02:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|