aboutsummaryrefslogtreecommitdiff
path: root/src/ChannelTopPanel.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-29 12:29:01 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-29 12:29:13 +0200
commit607b15dbc2e1dfa8633e7ae679b709fe21c94599 (patch)
tree6e323ec65de8c5f362a08abf8fef5c12b8398d4f /src/ChannelTopPanel.cpp
parente7caed2208893723181892d5e197b924311373fb (diff)
Fix image ratio, implement scroll locking (cant scroll outside messages)
Diffstat (limited to 'src/ChannelTopPanel.cpp')
-rw-r--r--src/ChannelTopPanel.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ChannelTopPanel.cpp b/src/ChannelTopPanel.cpp
index 9f57d27..8d9b0c8 100644
--- a/src/ChannelTopPanel.cpp
+++ b/src/ChannelTopPanel.cpp
@@ -17,7 +17,6 @@ namespace dchat
const float BOTTOM_LINE_HEIGHT = 2.0f;
const float PADDING_TOP = 20.0f;
const float PADDING_BOTTOM = PADDING_TOP;
- const sf::Font *FONT = ResourceCache::getFont("fonts/Roboto-Regular.ttf");
static void drawGradientLine(const sf::Vector2f &position, const sf::Vector2f &size, const LineColor &color, sf::RenderWindow &window)
{
@@ -62,7 +61,7 @@ namespace dchat
sf::String str = "# ";
str += sf::String::fromUtf8(currentChannel->getName().begin(), currentChannel->getName().end());
float fontSize = FONT_SIZE * Settings::getScaling();
- sf::Text text(str, *FONT, fontSize);
+ sf::Text text(str, *ResourceCache::getFont("fonts/Roboto-Regular.ttf"), fontSize);
auto textBounds = text.getLocalBounds();
text.setPosition(floor((float)windowSize.x * 0.5f - textBounds.width * 0.5f), PADDING_TOP);
text.setFillColor(ColorScheme::getTextRegularColor());
@@ -72,6 +71,6 @@ namespace dchat
float ChannelTopPanel::getHeight()
{
float fontSize = FONT_SIZE * Settings::getScaling();
- return floor(FONT->getLineSpacing(fontSize) + PADDING_TOP + PADDING_BOTTOM);
+ return floor(ResourceCache::getFont("fonts/Roboto-Regular.ttf")->getLineSpacing(fontSize) + PADDING_TOP + PADDING_BOTTOM);
}
}