2017-09-21 12:15:01 +02:00
|
|
|
#include "messagecolor.hpp"
|
2017-09-21 00:54:10 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace messages {
|
2017-12-16 17:53:48 +01:00
|
|
|
|
2017-09-21 12:15:01 +02:00
|
|
|
MessageColor::MessageColor(const QColor &_color)
|
2017-09-21 00:54:10 +02:00
|
|
|
: type(Type::Custom)
|
2017-09-21 12:15:01 +02:00
|
|
|
, color(_color)
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-09-21 12:15:01 +02:00
|
|
|
MessageColor::MessageColor(Type _type)
|
|
|
|
: type(_type)
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageColor::Type MessageColor::getType() const
|
|
|
|
{
|
|
|
|
return this->type;
|
|
|
|
}
|
|
|
|
|
2017-12-31 22:58:35 +01:00
|
|
|
const QColor &MessageColor::getColor(singletons::ThemeManager &themeManager) const
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
|
|
|
switch (this->type) {
|
|
|
|
case Type::Custom:
|
|
|
|
return this->color;
|
|
|
|
case Type::Text:
|
2017-12-31 00:50:07 +01:00
|
|
|
return themeManager.Text;
|
2017-09-21 00:54:10 +02:00
|
|
|
case Type::System:
|
2017-12-31 00:50:07 +01:00
|
|
|
return themeManager.SystemMessageColor;
|
2017-09-21 00:54:10 +02:00
|
|
|
case Type::Link:
|
2017-12-31 00:50:07 +01:00
|
|
|
return themeManager.TextLink;
|
2017-09-21 00:54:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static QColor _default;
|
|
|
|
return _default;
|
|
|
|
}
|
2017-12-16 17:53:48 +01:00
|
|
|
|
|
|
|
} // namespace messages
|
|
|
|
} // namespace chatterino
|