aboutsummaryrefslogtreecommitdiff
path: root/src/ChannelTopPanel.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-29 09:31:06 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-29 09:31:10 +0200
commite7caed2208893723181892d5e197b924311373fb (patch)
tree1a92cd65f23537eb57b4d80646e84bd359bc0ee2 /src/ChannelTopPanel.cpp
parentf90a5705bd65a4ebb5edc9df003a383039fec555 (diff)
Improve scaling, start implementing color scheme
Diffstat (limited to 'src/ChannelTopPanel.cpp')
-rw-r--r--src/ChannelTopPanel.cpp30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/ChannelTopPanel.cpp b/src/ChannelTopPanel.cpp
index 534f989..9f57d27 100644
--- a/src/ChannelTopPanel.cpp
+++ b/src/ChannelTopPanel.cpp
@@ -2,6 +2,7 @@
#include "../include/Settings.hpp"
#include "../include/ResourceCache.hpp"
#include "../include/Channel.hpp"
+#include "../include/ColorScheme.hpp"
#include <SFML/Graphics/RectangleShape.hpp>
#include <cmath>
@@ -37,21 +38,14 @@ namespace dchat
void ChannelTopPanel::draw(sf::RenderWindow &window)
{
- const sf::Color backgroundColor(40, 40, 40);
- const sf::Color lineSideColor(40, 40, 40);
- const sf::Color lineCenterColor(80, 40, 40);
+ const sf::Color lineSideColor = ColorScheme::getBackgroundColor();
+ const sf::Color lineCenterColor = lineSideColor + sf::Color(40, 0, 0);
auto windowSize = window.getSize();
sf::RectangleShape rect(sf::Vector2f(windowSize.x, getHeight() - BOTTOM_LINE_HEIGHT));
- rect.setFillColor(backgroundColor);
+ rect.setFillColor(ColorScheme::getBackgroundColor());
window.draw(rect);
- /*
- rect.setFillColor(sf::Color(70, 40, 40));
- rect.setSize(sf::Vector2f(windowSize.x, BOTTOM_LINE_HEIGHT));
- rect.setPosition(0.0f, getHeight() - BOTTOM_LINE_HEIGHT);
- window.draw(rect);
- */
sf::Vector2f bottomLinePos(0.0f, getHeight() - BOTTOM_LINE_HEIGHT);
sf::Vector2f bottomLineSize(windowSize.x, BOTTOM_LINE_HEIGHT);
@@ -71,22 +65,8 @@ namespace dchat
sf::Text text(str, *FONT, fontSize);
auto textBounds = text.getLocalBounds();
text.setPosition(floor((float)windowSize.x * 0.5f - textBounds.width * 0.5f), PADDING_TOP);
- text.setFillColor(sf::Color(240, 240, 240));
+ text.setFillColor(ColorScheme::getTextRegularColor());
window.draw(text);
- /*
- const sf::Font *font = ResourceCache::getFont("fonts/Roboto-Regular.ttf");
- sf::Vector2f position(10.0f, 10.0f);
- for(Channel *channel : channels)
- {
- // TODO: Remove this shit
- sf::String str = "# ";
- str += sf::String::fromUtf8(channel->getName().begin(), channel->getName().end());
- sf::Text text(str, *font, FONT_SIZE * Settings::getScaling());
- text.setPosition(position);
- window.draw(text);
- position.y += font->getLineSpacing(FONT_SIZE * Settings::getScaling());
- }
- */
}
float ChannelTopPanel::getHeight()