From 6a2b5008be8104680826fe40fa8e674e9357c044 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 19 Oct 2020 23:33:23 +0200 Subject: Add thumbnail loading animation Use correct ref in matrix replies, make text that contains our user id also count as a mention. --- include/Body.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/Body.hpp') diff --git a/include/Body.hpp b/include/Body.hpp index 9c7c1c1..ce61811 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -3,7 +3,6 @@ #include "Text.hpp" #include "AsyncImageLoader.hpp" #include -#include #include #include #include "../external/RoundedRectangleShape.hpp" @@ -14,6 +13,7 @@ namespace sf { class RenderWindow; class Shader; + class Texture; } namespace QuickMedia { @@ -113,7 +113,7 @@ namespace QuickMedia { std::vector replies; std::string post_number; void *userdata; // Not managed, should be deallocated by whoever sets this - sf::Int32 last_drawn_time; + double last_drawn_time; EmbeddedItemStatus embedded_item_status = EmbeddedItemStatus::NONE; std::shared_ptr embedded_item; // Used by matrix for example to display reply message body. Note: only the first level of embedded items is rendered (not recursive, this is done on purpose) ThumbnailMaskType thumbnail_mask_type = ThumbnailMaskType::NONE; @@ -134,7 +134,7 @@ namespace QuickMedia { class Body { public: - Body(Program *program, sf::Font *font, sf::Font *bold_font, sf::Font *cjk_font); + Body(Program *program, sf::Font *font, sf::Font *bold_font, sf::Font *cjk_font, sf::Texture &loading_icon_texture); // Select previous page, ignoring invisible items. Returns true if the item was changed. This can be used to check if the top was hit when wrap_around is set to false bool select_previous_page(); @@ -229,9 +229,11 @@ namespace QuickMedia { sf::RectangleShape item_separator; sf::RoundedRectangleShape item_background; sf::Sprite image; + sf::Sprite loading_icon; int num_visible_items; bool last_item_fully_visible; int last_fully_visible_item; sf::Clock draw_timer; + double elapsed_time_sec = 0.0; }; } \ No newline at end of file -- cgit v1.2.3