From 21e71e96cb2da093718a57a202c6a3f038cf6f7e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 29 Apr 2018 12:40:15 +0200 Subject: Add line above chatbar --- src/Chatbar.cpp | 9 ++++++++- src/MessageBoard.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Chatbar.cpp b/src/Chatbar.cpp index f68d363..a711d9f 100644 --- a/src/Chatbar.cpp +++ b/src/Chatbar.cpp @@ -22,6 +22,8 @@ namespace dchat const float PADDING_SIDE = 20.0f; const float PADDING_TOP = 30.0f; const float PADDING_BOTTOM = 30.0f; + const float LINE_PADDING_SIDE = 20.0f; + const float LINE_HEIGHT = 1.0f; Chatbar::Chatbar() : text("", *ResourceCache::getFont("fonts/Roboto-Regular.ttf"), FONT_SIZE * Settings::getScaling()), @@ -275,8 +277,13 @@ namespace dchat text.setCharacterSize(FONT_SIZE * Settings::getScaling()); const float fontHeight = text.getFont()->getLineSpacing(text.getCharacterSize()); + sf::RectangleShape lineShape(sf::Vector2f(floor(windowSize.x - ChannelSidePanel::getWidth() - UsersSidePanel::getWidth() - LINE_PADDING_SIDE * 2.0f), LINE_HEIGHT)); + lineShape.setFillColor(ColorScheme::getBackgroundColor() + sf::Color(10, 10, 10)); + lineShape.setPosition(ChannelSidePanel::getWidth() + LINE_PADDING_SIDE, floor(windowSize.y - getHeight())); + window.draw(lineShape); + sf::Vector2f inputBackgroundSize(floor(windowSize.x - ChannelSidePanel::getWidth() - UsersSidePanel::getWidth() - PADDING_SIDE * 2.0f), floor(fontHeight * 1.7f + BOX_PADDING_Y * 2.0f)); - sf::Vector2f backgroundSize(floor(windowSize.x - ChannelSidePanel::getWidth() - UsersSidePanel::getWidth()), floor(PADDING_TOP + inputBackgroundSize.y + PADDING_BOTTOM)); + sf::Vector2f backgroundSize(floor(windowSize.x - ChannelSidePanel::getWidth() - UsersSidePanel::getWidth()), floor(getHeight() - LINE_HEIGHT)); background.setSize(backgroundSize); background.setPosition(ChannelSidePanel::getWidth(), floor(windowSize.y - backgroundSize.y)); window.draw(background); diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp index d16d16c..a2b9284 100644 --- a/src/MessageBoard.cpp +++ b/src/MessageBoard.cpp @@ -28,7 +28,7 @@ namespace dchat const float MESSAGE_PADDING_BOTTOM = 30.0f; const float PADDING_SIDE = 40.0f; - const float PADDING_TOP = 5.0f; + const float PADDING_TOP = 0.0f; const float LINE_SIDE_PADDING = 20.0f; const float LINE_HEIGHT = 1.0f; -- cgit v1.2.3