diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-09-25 21:40:22 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-09-25 22:27:15 +0200 |
commit | d5d462f555ef9d7ce7e001aca5586c19b4d9edc8 (patch) | |
tree | 8fa80cce39f3df27513ff16815bb7b5d11814d8e /src/Body.cpp | |
parent | eac2ace1c14c1ae0564d757b26a359c6bd4b754a (diff) |
Matrix: add display name colors depending on user id
Diffstat (limited to 'src/Body.cpp')
-rw-r--r-- | src/Body.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index f97d611..2bd5499 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -21,9 +21,11 @@ namespace QuickMedia { dirty_description(false), dirty_author(false), thumbnail_is_local(false), - title_color(sf::Color::White) + title_color(sf::Color::White), + author_color(sf::Color::White) { - set_title(std::move(_title)); + if(!_title.empty()) + set_title(std::move(_title)); } BodyItem::BodyItem(const BodyItem &other) { @@ -53,6 +55,7 @@ namespace QuickMedia { replies = other.replies; post_number = other.post_number; title_color = other.title_color; + author_color = other.author_color; } Body::Body(Program *program, sf::Font *font, sf::Font *bold_font, sf::Font *cjk_font) : @@ -405,6 +408,7 @@ namespace QuickMedia { body_item->author_text->setString(std::move(str)); else body_item->author_text = std::make_unique<Text>(std::move(str), bold_font, cjk_font, 14, size.x - 50 - image_padding_x * 2.0f); + body_item->author_text->setFillColor(body_item->author_color); body_item->author_text->updateGeometry(); } } |