From 1e0e68f9cda51c881b32a54d9eece71c1428f7ac Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 22 Apr 2018 05:58:44 +0200 Subject: Add video and gif support Gif streams from url. Todo: Add play controls to video --- include/MessagePart.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/MessagePart.hpp') diff --git a/include/MessagePart.hpp b/include/MessagePart.hpp index d0a0a03..00544fb 100644 --- a/include/MessagePart.hpp +++ b/include/MessagePart.hpp @@ -16,7 +16,7 @@ namespace dchat EMOJI }; - MessagePart(Type _type) : type(_type) {} + MessagePart(Type _type, bool _newLine) : type(_type), newLine(_newLine) {} virtual ~MessagePart(){} static float getSizeScaled(); @@ -24,12 +24,13 @@ namespace dchat virtual sf::Vector2f getSize() const = 0; const Type type; + bool newLine; }; class MessagePartText : public MessagePart { public: - MessagePartText(const std::string &text); + MessagePartText(const std::string &text, bool newLine); static float getFontSizeScaled(); virtual sf::Vector2f getPosition() const override; @@ -41,7 +42,7 @@ namespace dchat class MessagePartEmoji : public MessagePart { public: - MessagePartEmoji(const std::string &url); + MessagePartEmoji(const std::string &url, bool newLine); static float getHeightScaled(); virtual sf::Vector2f getPosition() const override; -- cgit v1.2.3