2017-10-04 11:33:34 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QPaintEvent>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class TypingDisplay : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2018-08-08 12:51:40 +03:00
|
|
|
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
|
|
|
|
2017-10-04 11:33:34 +03:00
|
|
|
public:
|
|
|
|
TypingDisplay(QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
void setUsers(const QStringList &user_ids);
|
|
|
|
|
2018-08-08 12:51:40 +03:00
|
|
|
void setTextColor(const QColor &color) { textColor_ = color; };
|
|
|
|
QColor textColor() const { return textColor_; };
|
|
|
|
|
2017-10-04 11:33:34 +03:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
|
|
|
|
private:
|
2018-08-08 12:51:40 +03:00
|
|
|
QColor textColor_;
|
2017-10-04 11:33:34 +03:00
|
|
|
QString text_;
|
|
|
|
};
|