summary refs log tree commit diff
path: root/src/TypingDisplay.h
blob: d5e2f29c956b2427abbe693a52afb1d79194d41f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <QPaintEvent>
#include <QWidget>

class TypingDisplay : public QWidget
{
        Q_OBJECT

        Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)

public:
        TypingDisplay(QWidget *parent = nullptr);

        void setUsers(const QStringList &user_ids);

        void setTextColor(const QColor &color) { textColor_ = color; };
        QColor textColor() const { return textColor_; };

protected:
        void paintEvent(QPaintEvent *event) override;

private:
        QColor textColor_;
        QString text_;
};