From d5d462f555ef9d7ce7e001aca5586c19b4d9edc8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 25 Sep 2020 21:40:22 +0200 Subject: Matrix: add display name colors depending on user id --- src/Body.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Body.cpp') 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(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(); } } -- cgit v1.2.3