mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
36 lines
757 B
C++
36 lines
757 B
C++
#include "MessageColor.hpp"
|
|
|
|
#include "singletons/Theme.hpp"
|
|
|
|
namespace chatterino {
|
|
|
|
MessageColor::MessageColor(const QColor &color)
|
|
: type_(Type::Custom)
|
|
, customColor_(color)
|
|
{
|
|
}
|
|
|
|
MessageColor::MessageColor(Type type)
|
|
: type_(type)
|
|
{
|
|
}
|
|
|
|
const QColor &MessageColor::getColor(Theme &themeManager) const
|
|
{
|
|
switch (this->type_)
|
|
{
|
|
case Type::Custom:
|
|
return this->customColor_;
|
|
case Type::Text:
|
|
return themeManager.messages.textColors.regular;
|
|
case Type::System:
|
|
return themeManager.messages.textColors.system;
|
|
case Type::Link:
|
|
return themeManager.messages.textColors.link;
|
|
}
|
|
|
|
static QColor _default;
|
|
return _default;
|
|
}
|
|
|
|
} // namespace chatterino
|