Improve color-coding for user disambiguation

See also: https://github.com/quotient-im/libQuotient/wiki/User-color-coding-standard-draft-proposal
This commit is contained in:
Alexey Andreev
2020-11-25 21:21:12 +03:00
committed by Carl Schwan
parent e838f7423d
commit d6e1a6a45b
2 changed files with 45 additions and 6 deletions

View File

@@ -10,17 +10,30 @@
#include "room.h"
#include "user.h"
namespace Kirigami
{
class PlatformTheme;
}
using namespace Quotient;
class NeoChatUser : public User
{
Q_OBJECT
Q_PROPERTY(QColor color READ color CONSTANT)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
public:
NeoChatUser(QString userId, Connection *connection)
: User(userId, connection)
{
}
NeoChatUser(QString userId, Connection *connection);
public Q_SLOTS:
QColor color();
void setColor(QColor color);
Q_SIGNALS:
void colorChanged(QColor color);
private:
Kirigami::PlatformTheme *m_theme = nullptr;
QColor m_color;
void polishColor();
};