mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
minor changes to MessageColor
This commit is contained in:
parent
11775071b9
commit
772dc97d92
2 changed files with 3 additions and 13 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue