aboutsummaryrefslogtreecommitdiff
path: root/include/BodyItem.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-09-22 20:10:48 +0200
committerdec05eba <dec05eba@protonmail.com>2021-09-22 20:10:48 +0200
commitfdeb82815db468ac7e99e9646f57bed2bf1832de (patch)
treeffc1ca95e05f47e26c21cce29f5510275e01787e /include/BodyItem.hpp
parent7934864d58ec39b237e2b45d0180aa567b29b944 (diff)
Sort anilist recommendations by best match, show episode duration, show titles differently
Diffstat (limited to 'include/BodyItem.hpp')
-rw-r--r--include/BodyItem.hpp8
1 files changed, 6 insertions, 2 deletions
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<BodyItem> create(std::string title) { return std::make_shared<BodyItem>(std::move(title)); }
+ static std::shared_ptr<BodyItem> 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
@@ -162,6 +163,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)
std::string title;
@@ -171,6 +174,7 @@ namespace QuickMedia {
sf::Color title_color;
sf::Color author_color;
sf::Color description_color;
+ bool selectable;
};
using BodyItems = std::vector<std::shared_ptr<BodyItem>>;