aboutsummaryrefslogtreecommitdiff
path: root/src/MessageBoard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MessageBoard.cpp')
-rw-r--r--src/MessageBoard.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp
index 4cab31d..a0d1ab2 100644
--- a/src/MessageBoard.cpp
+++ b/src/MessageBoard.cpp
@@ -2,6 +2,8 @@
#include "../include/Settings.hpp"
#include "../include/ResourceCache.hpp"
#include "../include/Gif.hpp"
+#include "../include/ChannelSidePanel.hpp"
+#include "../include/UsersSidePanel.hpp"
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Window/Mouse.hpp>
@@ -17,6 +19,8 @@ namespace dchat
const float USERNAME_PADDING_BOTTOM = 0.0f;
const float MESSAGE_PADDING_BOTTOM = 20.0f;
+ const float PADDING_SIDE = 20.0f;
+
MessageBoard::MessageBoard(const sf::Vector2u &size) :
selectingText(false),
leftMouseButtonPressed(false),
@@ -93,10 +97,10 @@ namespace dchat
}
}
- void MessageBoard::draw(sf::RenderWindow &window, const sf::Vector2f &pos, Cache &cache)
+ void MessageBoard::draw(sf::RenderWindow &window, Cache &cache)
{
auto windowSize = window.getSize();
- sf::Vector2u backgroundSize(floor(windowSize.x - pos.x * 2.0f), floor(windowSize.y));
+ sf::Vector2u backgroundSize(floor(windowSize.x - ChannelSidePanel::getWidth() - UsersSidePanel::getWidth() - PADDING_SIDE * 2.0f), floor(windowSize.y));
//if(backgroundSize != staticContentTexture.getSize())
// updateStaticContentTexture(backgroundSize);
@@ -116,8 +120,8 @@ namespace dchat
if(dirty)
{
- sf::Vector2f position = pos;
- position.x += 20.0f;
+ sf::Vector2f position;
+ position.x = ChannelSidePanel::getWidth() + PADDING_SIDE;
position.y += scroll;
for(Message *message : messages)
{