minor changes to MessageColor

This commit is contained in:
fourtf 2018-01-28 03:57:22 +01:00
parent 11775071b9
commit 772dc97d92
2 changed files with 3 additions and 13 deletions

View file

@ -2,10 +2,9 @@
namespace chatterino {
namespace messages {
MessageColor::MessageColor(const QColor &_color)
: type(Type::Custom)
, color(_color)
, customColor(_color)
{
}
@ -14,16 +13,11 @@ MessageColor::MessageColor(Type _type)
{
}
MessageColor::Type MessageColor::getType() const
{
return this->type;
}
const QColor &MessageColor::getColor(singletons::ThemeManager &themeManager) const
{
switch (this->type) {
case Type::Custom:
return this->color;
return this->customColor;
case Type::Text:
return themeManager.messages.textColors.regular;
case Type::System:
@ -35,6 +29,5 @@ const QColor &MessageColor::getColor(singletons::ThemeManager &themeManager) con
static QColor _default;
return _default;
}
} // namespace messages
} // namespace chatterino

View file

@ -6,20 +6,17 @@
namespace chatterino {
namespace messages {
struct MessageColor {
enum Type { Custom, Text, Link, System };
MessageColor(const QColor &color);
MessageColor(Type type = Text);
Type getType() const;
const QColor &getColor(singletons::ThemeManager &themeManager) const;
private:
Type type;
QColor color;
QColor customColor;
};
} // namespace messages
} // namespace chatterino