mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "resizingtextedit.hpp"
|
|
#include "widgets/basewidget.hpp"
|
|
#include "widgets/chatwidgetheaderbutton.hpp"
|
|
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QPaintEvent>
|
|
#include <QTextEdit>
|
|
#include <QVBoxLayout>
|
|
#include <QWidget>
|
|
|
|
namespace chatterino {
|
|
namespace widgets {
|
|
|
|
class ChatWidget;
|
|
|
|
class ChatWidgetInput : public BaseWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ChatWidgetInput(ChatWidget *_chatWidget);
|
|
~ChatWidgetInput();
|
|
|
|
protected:
|
|
virtual void paintEvent(QPaintEvent *) override;
|
|
virtual void resizeEvent(QResizeEvent *) override;
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
private:
|
|
ChatWidget *const chatWidget;
|
|
|
|
QHBoxLayout hbox;
|
|
QVBoxLayout vbox;
|
|
QHBoxLayout editContainer;
|
|
ResizingTextEdit textInput;
|
|
QLabel textLengthLabel;
|
|
ChatWidgetHeaderButton emotesLabel;
|
|
QStringList prevMsg;
|
|
unsigned int prevIndex = 0;
|
|
virtual void refreshTheme() override;
|
|
|
|
private slots:
|
|
void setMessageLengthVisible(bool value)
|
|
{
|
|
textLengthLabel.setHidden(!value);
|
|
}
|
|
void editTextChanged();
|
|
// void editKeyPressed(QKeyEvent *event);
|
|
|
|
friend class ChatWidget;
|
|
};
|
|
|
|
} // namespace widgets
|
|
} // namespace chatterino
|