From fdeb82815db468ac7e99e9646f57bed2bf1832de Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 22 Sep 2021 20:10:48 +0200 Subject: Sort anilist recommendations by best match, show episode duration, show titles differently --- include/BodyItem.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/BodyItem.hpp') diff --git a/include/BodyItem.hpp b/include/BodyItem.hpp index e2f4918..5889d58 100644 --- a/include/BodyItem.hpp +++ b/include/BodyItem.hpp @@ -43,11 +43,10 @@ namespace QuickMedia { class BodyItem { public: - BodyItem(std::string _title); BodyItem(const BodyItem&) = delete; BodyItem& operator=(const BodyItem &other); - static std::shared_ptr create(std::string title) { return std::make_shared(std::move(title)); } + static std::shared_ptr create(std::string title, bool selectable = true); void set_title(std::string new_title) { if(title == new_title) @@ -122,6 +121,8 @@ namespace QuickMedia { sf::Color get_description_color() const { return description_color; } sf::Color get_author_color() const { return author_color; } + bool is_selectable() const { return selectable; } + void draw_list(Body *body, sf::RenderTarget &render_target); // TODO: Use a list of strings instead, not all plugins need all of these fields @@ -161,6 +162,8 @@ namespace QuickMedia { // Internal use only int keep_alive_frames = 0; + private: + BodyItem(std::string _title, bool selectable); private: // TODO: Clean up these strings when set in text, and get_title for example should return |title_text.getString()| // TODO: Use sf::String instead, removes the need to convert to utf32 every time the text is dirty (for example when resizing window) @@ -171,6 +174,7 @@ namespace QuickMedia { sf::Color title_color; sf::Color author_color; sf::Color description_color; + bool selectable; }; using BodyItems = std::vector>; -- cgit v1.2.3