From 607b15dbc2e1dfa8633e7ae679b709fe21c94599 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 29 Apr 2018 12:29:01 +0200 Subject: Fix image ratio, implement scroll locking (cant scroll outside messages) --- include/Chatbar.hpp | 2 ++ include/ColorScheme.hpp | 14 +++++++++++--- include/Gif.hpp | 4 +++- include/MessageBoard.hpp | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/Chatbar.hpp b/include/Chatbar.hpp index b6c6be8..6ae2190 100644 --- a/include/Chatbar.hpp +++ b/include/Chatbar.hpp @@ -30,6 +30,8 @@ namespace dchat void processEvent(const sf::Event &event, Channel *channel); void draw(sf::RenderWindow &window); + + static float getHeight(); private: void processChatCommand(const StringView &cmd); private: diff --git a/include/ColorScheme.hpp b/include/ColorScheme.hpp index 07010ba..64dbeec 100644 --- a/include/ColorScheme.hpp +++ b/include/ColorScheme.hpp @@ -7,9 +7,17 @@ namespace dchat class ColorScheme { public: - static sf::Color getBackgroundColor() { return sf::Color(40, 40, 40); } - static sf::Color getPanelColor() { return sf::Color(35, 35, 35); } + enum class Type + { + LIGHT, + DARK + }; - static sf::Color getTextRegularColor() { return sf::Color(240, 240, 240); } + static Type getType(); + static void setType(Type type); + + static sf::Color getBackgroundColor(); + static sf::Color getPanelColor(); + static sf::Color getTextRegularColor(); }; } diff --git a/include/Gif.hpp b/include/Gif.hpp index 87e6956..84299e9 100644 --- a/include/Gif.hpp +++ b/include/Gif.hpp @@ -28,8 +28,10 @@ namespace dchat Gif(StringView &&fileContent); ~Gif(); + sf::Vector2u getSize() const; + void setPosition(const sf::Vector2f &position); - void setSize(const sf::Vector2f &size); + void setScale(const sf::Vector2f &scale); void draw(sf::RenderTarget &target); static bool isDataGif(const StringView &data); diff --git a/include/MessageBoard.hpp b/include/MessageBoard.hpp index b431af8..739f161 100644 --- a/include/MessageBoard.hpp +++ b/include/MessageBoard.hpp @@ -35,5 +35,6 @@ namespace dchat double scroll; double scrollSpeed; sf::Clock frameTimer; + double totalHeight; }; } -- cgit v1.2.3