From e7caed2208893723181892d5e197b924311373fb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 29 Apr 2018 09:31:06 +0200 Subject: Improve scaling, start implementing color scheme --- src/ChannelTopPanel.cpp | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'src/ChannelTopPanel.cpp') 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 #include @@ -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() -- cgit v1.2.3