diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-11-11 10:50:39 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-11-11 10:50:39 +0100 |
commit | d274d3a6dfc0864ec6a44e7d6948c2d873eb6f76 (patch) | |
tree | a4308da3afd0e7c567c40f8a26ab1bdcbc58a898 /include | |
parent | 25f6303ae40e9245f42545d120efa8b6f9be98d7 (diff) |
Add image (custom emoji) alt text for copy-pasting, limit custom emoji size in room description, change max size to 32, 32, cache custom emoji locally
Diffstat (limited to 'include')
-rw-r--r-- | include/Text.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/Text.hpp b/include/Text.hpp index 245284f..89aba99 100644 --- a/include/Text.hpp +++ b/include/Text.hpp @@ -51,8 +51,9 @@ namespace QuickMedia } // If size is {0, 0} then the image is drawn at its original size - void create_image(std::string url, bool local, mgl::vec2i size) { + void create_image(std::string url, bool local, mgl::vec2i size, std::string alt) { this->url = std::move(url); + this->alt = std::move(alt); this->local = local; this->size = size; type = Type::IMAGE; @@ -68,6 +69,7 @@ namespace QuickMedia // TODO: Remove these std::string url; + std::string alt; bool local = false; mgl::vec2i pos; mgl::vec2i size; @@ -94,7 +96,7 @@ namespace QuickMedia const std::string& getString() const; void appendText(const std::string &str); // size = {0, 0} = keep original image size - static std::string formatted_image(const std::string &url, bool local, mgl::vec2i size); + static std::string formatted_image(const std::string &url, bool local, mgl::vec2i size, const std::string &alt); // text_flags is bit-or of FormattedTextFlag static std::string formatted_text(const std::string &text, mgl::Color color, uint8_t text_flags); void insert_text_at_caret_position(const std::string &str); |