From 5c72463c029804c85479d2c4426397d932c88ee1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 20 Sep 2020 18:59:04 +0200 Subject: Add comments and trusted/remake colors to nyaa.si torrents --- src/Body.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/Body.cpp') diff --git a/src/Body.cpp b/src/Body.cpp index 2579d64..73c3932 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -11,6 +11,31 @@ const sf::Color front_color(43, 45, 47); const sf::Color back_color(33, 35, 37); namespace QuickMedia { + BodyItem::BodyItem(std::string _title): visible(true), dirty(true), background_color(front_color) { + set_title(std::move(_title)); + } + + BodyItem::BodyItem(const BodyItem &other) { + title = other.title; + description = other.description; + url = other.url; + thumbnail_url = other.thumbnail_url; + attached_content_url = other.attached_content_url; + author = other.author; + visible = other.visible; + dirty = other.dirty; + if(other.title_text) + title_text = std::make_unique(*other.title_text); + else + title_text = nullptr; + if(other.description_text) + description_text = std::make_unique(*other.description_text); + else + description_text = nullptr; + replies = other.replies; + post_number = other.post_number; + } + Body::Body(Program *program, sf::Font *font, sf::Font *bold_font) : program(program), font(font), @@ -305,7 +330,7 @@ namespace QuickMedia { //item_pos.x += selected_border_width; item_background.setFillColor(sf::Color(0, 85, 119)); } else { - item_background.setFillColor(front_color); + item_background.setFillColor(item->background_color); } item_pos.x = std::floor(item_pos.x); -- cgit v1.2.3