aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-20 18:59:04 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-20 18:59:04 +0200
commit5c72463c029804c85479d2c4426397d932c88ee1 (patch)
tree17d40e579cdc68d07e51233033cfa9db9b534c1d /src/Body.cpp
parentf41a28fe3ec5042849583081ca0e1aa6c38a7187 (diff)
Add comments and trusted/remake colors to nyaa.si torrents
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp27
1 files changed, 26 insertions, 1 deletions
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<Text>(*other.title_text);
+ else
+ title_text = nullptr;
+ if(other.description_text)
+ description_text = std::make_unique<Text>(*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);