2018-06-26 14:09:39 +02:00
|
|
|
#include "MessageColor.hpp"
|
2017-09-21 00:54:10 +02:00
|
|
|
|
2018-08-11 22:23:06 +02:00
|
|
|
#include "singletons/Theme.hpp"
|
|
|
|
|
2017-09-21 00:54:10 +02:00
|
|
|
namespace chatterino {
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
MessageColor::MessageColor(const QColor &color)
|
|
|
|
: type_(Type::Custom)
|
|
|
|
, customColor_(color)
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
MessageColor::MessageColor(Type type)
|
|
|
|
: type_(type)
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-06-28 20:03:04 +02:00
|
|
|
const QColor &MessageColor::getColor(Theme &themeManager) const
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
2018-07-06 19:23:47 +02:00
|
|
|
switch (this->type_) {
|
2017-09-21 00:54:10 +02:00
|
|
|
case Type::Custom:
|
2018-07-06 19:23:47 +02:00
|
|
|
return this->customColor_;
|
2017-09-21 00:54:10 +02:00
|
|
|
case Type::Text:
|
2018-01-02 02:15:11 +01:00
|
|
|
return themeManager.messages.textColors.regular;
|
2017-09-21 00:54:10 +02:00
|
|
|
case Type::System:
|
2018-01-02 02:15:11 +01:00
|
|
|
return themeManager.messages.textColors.system;
|
2017-09-21 00:54:10 +02:00
|
|
|
case Type::Link:
|
2018-01-02 02:15:11 +01:00
|
|
|
return themeManager.messages.textColors.link;
|
2017-09-21 00:54:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static QColor _default;
|
|
|
|
return _default;
|
|
|
|
}
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2017-12-16 17:53:48 +01:00
|
|
|
} // namespace chatterino
|