aboutsummaryrefslogtreecommitdiff
path: root/src/BodyItem.cpp
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 /src/BodyItem.cpp
parent7934864d58ec39b237e2b45d0180aa567b29b944 (diff)
Sort anilist recommendations by best match, show episode duration, show titles differently
Diffstat (limited to 'src/BodyItem.cpp')
-rw-r--r--src/BodyItem.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/BodyItem.cpp b/src/BodyItem.cpp
index 0b41893..6523738 100644
--- a/src/BodyItem.cpp
+++ b/src/BodyItem.cpp
@@ -4,7 +4,12 @@
#include <cmath>
namespace QuickMedia {
- BodyItem::BodyItem(std::string _title) :
+ // static
+ std::shared_ptr<BodyItem> BodyItem::create(std::string title, bool selectable) {
+ return std::shared_ptr<BodyItem>(new BodyItem(std::move(title), selectable));
+ }
+
+ BodyItem::BodyItem(std::string _title, bool selectable) :
visible(true),
dirty(false),
dirty_description(false),
@@ -15,7 +20,8 @@ namespace QuickMedia {
timestamp(0),
title_color(get_theme().text_color),
author_color(get_theme().text_color),
- description_color(get_theme().text_color)
+ description_color(get_theme().text_color),
+ selectable(selectable)
{
if(!_title.empty())
set_title(std::move(_title));
@@ -43,7 +49,7 @@ namespace QuickMedia {
loaded_content_height = 0.0f;
embedded_item_status = other.embedded_item_status;
if(other.embedded_item) {
- embedded_item.reset(new BodyItem(""));
+ embedded_item.reset(new BodyItem("", true));
*embedded_item = *other.embedded_item;
} else {
embedded_item.reset();
@@ -66,6 +72,7 @@ namespace QuickMedia {
description_color = other.description_color;
extra = other.extra;
keep_alive_frames = other.keep_alive_frames;
+ selectable = other.selectable;
return *this;
}