minor changes to MessageColor
This commit is contained in:
@@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
namespace messages {
|
namespace messages {
|
||||||
|
|
||||||
MessageColor::MessageColor(const QColor &_color)
|
MessageColor::MessageColor(const QColor &_color)
|
||||||
: type(Type::Custom)
|
: 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
|
const QColor &MessageColor::getColor(singletons::ThemeManager &themeManager) const
|
||||||
{
|
{
|
||||||
switch (this->type) {
|
switch (this->type) {
|
||||||
case Type::Custom:
|
case Type::Custom:
|
||||||
return this->color;
|
return this->customColor;
|
||||||
case Type::Text:
|
case Type::Text:
|
||||||
return themeManager.messages.textColors.regular;
|
return themeManager.messages.textColors.regular;
|
||||||
case Type::System:
|
case Type::System:
|
||||||
@@ -35,6 +29,5 @@ const QColor &MessageColor::getColor(singletons::ThemeManager &themeManager) con
|
|||||||
static QColor _default;
|
static QColor _default;
|
||||||
return _default;
|
return _default;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace messages
|
} // namespace messages
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
@@ -6,20 +6,17 @@
|
|||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
namespace messages {
|
namespace messages {
|
||||||
|
|
||||||
struct MessageColor {
|
struct MessageColor {
|
||||||
enum Type { Custom, Text, Link, System };
|
enum Type { Custom, Text, Link, System };
|
||||||
|
|
||||||
MessageColor(const QColor &color);
|
MessageColor(const QColor &color);
|
||||||
MessageColor(Type type = Text);
|
MessageColor(Type type = Text);
|
||||||
|
|
||||||
Type getType() const;
|
|
||||||
const QColor &getColor(singletons::ThemeManager &themeManager) const;
|
const QColor &getColor(singletons::ThemeManager &themeManager) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Type type;
|
Type type;
|
||||||
QColor color;
|
QColor customColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace messages
|
} // namespace messages
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
Reference in New Issue
Block a user