mirror-chatterino2/src/widgets/chatwidgetinput.hpp

58 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
2017-01-01 02:30:42 +01:00
2017-06-11 09:31:45 +02:00
#include "resizingtextedit.hpp"
#include "widgets/basewidget.hpp"
2017-06-11 09:31:45 +02:00
#include "widgets/chatwidgetheaderbutton.hpp"
2017-01-21 05:14:27 +01:00
#include <QHBoxLayout>
#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-01-18 21:30:23 +01:00
namespace chatterino {
namespace widgets {
2017-01-29 13:23:22 +01:00
class ChatWidget;
class ChatWidgetInput : public BaseWidget
2017-01-01 02:30:42 +01:00
{
Q_OBJECT
public:
ChatWidgetInput(ChatWidget *_chatWidget);
2017-01-22 12:46:35 +01:00
~ChatWidgetInput();
2017-01-01 02:30:42 +01:00
protected:
virtual void paintEvent(QPaintEvent *) override;
virtual void resizeEvent(QResizeEvent *) override;
2017-01-20 06:10:28 +01:00
private:
ChatWidget *const chatWidget;
2017-01-29 13:23:22 +01:00
QHBoxLayout hbox;
QVBoxLayout vbox;
QHBoxLayout editContainer;
ResizingTextEdit textInput;
QLabel textLengthLabel;
ChatWidgetHeaderButton emotesLabel;
QStringList prevMsg;
unsigned int prevIndex = 0;
virtual void refreshTheme() override;
private slots:
2017-07-09 00:09:02 +02:00
void setMessageLengthVisible(bool value)
2017-01-22 12:46:35 +01:00
{
textLengthLabel.setHidden(!value);
2017-01-22 12:46:35 +01:00
}
2017-01-29 13:23:22 +01:00
void editTextChanged();
// void editKeyPressed(QKeyEvent *event);
friend class ChatWidget;
2017-01-01 02:30:42 +01:00
};
2017-04-14 17:52:22 +02:00
} // namespace widgets
} // namespace chatterino