nheko/src/TypingDisplay.h

37 lines
894 B
C
Raw Normal View History

2017-10-04 10:33:34 +02:00
#pragma once
#include "ui/OverlayWidget.h"
2017-10-04 10:33:34 +02:00
class QPaintEvent;
class TypingDisplay : public OverlayWidget
2017-10-04 10:33:34 +02:00
{
Q_OBJECT
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
2018-08-10 09:58:46 +02:00
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
2017-10-04 10:33:34 +02:00
public:
TypingDisplay(QWidget *parent = nullptr);
void setUsers(const QStringList &user_ids);
void setTextColor(const QColor &color) { textColor_ = color; };
QColor textColor() const { return textColor_; };
2018-08-10 09:58:46 +02:00
void setBackgroundColor(const QColor &color) { bgColor_ = color; };
QColor backgroundColor() const { return bgColor_; };
public slots:
void setOffset(int margin);
2017-10-04 10:33:34 +02:00
protected:
void paintEvent(QPaintEvent *event) override;
private:
int offset_;
QColor textColor_;
2018-08-10 09:58:46 +02:00
QColor bgColor_;
2017-10-04 10:33:34 +02:00
QString text_;
};