diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-29 12:40:15 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-04-29 12:40:22 +0200 |
commit | 21e71e96cb2da093718a57a202c6a3f038cf6f7e (patch) | |
tree | 3e33bb917dff0335139b0268db9ea770b08115c5 /src | |
parent | 607b15dbc2e1dfa8633e7ae679b709fe21c94599 (diff) |
Add line above chatbar
Diffstat (limited to 'src')
-rw-r--r-- | src/Chatbar.cpp | 9 | ||||
-rw-r--r-- | src/MessageBoard.cpp | 2 |
2 files changed, 9 insertions, 2 deletions
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; |