From 4a7b86829025664f6eeef6fcb5fc0894733f2ad6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 17 Oct 2020 13:42:31 +0200 Subject: Matrix: make displayname more bright, add circle mask shader for avatar and room thumbnails --- include/Body.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/Body.hpp') diff --git a/include/Body.hpp b/include/Body.hpp index cdb0ad0..7032ad8 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -13,6 +13,7 @@ namespace sf { class RenderWindow; + class Shader; } namespace QuickMedia { @@ -25,6 +26,11 @@ namespace QuickMedia { FAILED_TO_LOAD }; + enum class ThumbnailMaskType { + NONE, + CIRCLE + }; + class BodyItem { public: BodyItem(std::string _title); @@ -97,6 +103,7 @@ namespace QuickMedia { sf::Int32 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; private: // TODO: Clean up these strings when set in text, and get_title for example should return |title_text.getString()| std::string title; @@ -188,6 +195,7 @@ namespace QuickMedia { sf::Vector2f thumbnail_fallback_size; sf::Color line_seperator_color; BodyItemRenderCallback body_item_render_callback; + sf::Shader *thumbnail_mask_shader; private: void draw_item(sf::RenderWindow &window, BodyItem *item, const sf::Vector2f &pos, const sf::Vector2f &size, const float item_height, const int item_index, const Json::Value &content_progress, bool include_embedded_item = true); void update_dirty_state(BodyItem *body_item, sf::Vector2f size); -- cgit v1.2.3