aboutsummaryrefslogtreecommitdiff
path: root/include/Body.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/Body.hpp')
-rw-r--r--include/Body.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index 0bea3c2..4e30684 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -42,11 +42,12 @@ namespace QuickMedia {
// TODO: Use a list of strings instead, not all plugins need all of these fields
std::string url;
std::string thumbnail_url;
- std::string attached_content_url;
+ std::string attached_content_url; // TODO: Remove and use |url| instead
std::string author;
bool visible;
bool dirty;
bool dirty_description;
+ bool thumbnail_is_local;
std::unique_ptr<Text> title_text;
std::unique_ptr<Text> description_text;
// Used by image boards for example. The elements are indices to other body items
@@ -103,13 +104,17 @@ namespace QuickMedia {
std::thread thumbnail_load_thread;
bool draw_thumbnails;
bool wrap_around;
+ // Set to {0, 0} to disable resizing
+ sf::Vector2i thumbnail_resize_target_size;
+ sf::Vector2f thumbnail_fallback_size;
private:
struct ThumbnailData {
bool referenced;
std::shared_ptr<sf::Texture> texture;
+ bool loaded = false;
};
Program *program;
- std::shared_ptr<sf::Texture> load_thumbnail_from_url(const std::string &url);
+ std::shared_ptr<sf::Texture> load_thumbnail_from_url(const std::string &url, bool local, sf::Vector2i thumbnail_resize_target_size);
std::unordered_map<std::string, ThumbnailData> item_thumbnail_textures;
bool loading_thumbnail;
int selected_item;