diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-29 12:29:01 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-04-29 12:29:13 +0200 |
commit | 607b15dbc2e1dfa8633e7ae679b709fe21c94599 (patch) | |
tree | 6e323ec65de8c5f362a08abf8fef5c12b8398d4f /src/Chatbar.cpp | |
parent | e7caed2208893723181892d5e197b924311373fb (diff) |
Fix image ratio, implement scroll locking (cant scroll outside messages)
Diffstat (limited to 'src/Chatbar.cpp')
-rw-r--r-- | src/Chatbar.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Chatbar.cpp b/src/Chatbar.cpp index e88986a..f68d363 100644 --- a/src/Chatbar.cpp +++ b/src/Chatbar.cpp @@ -300,4 +300,11 @@ namespace dchat if(blinkElapsedTime > BLINK_TIME_VISIBLE_MS + BLINK_TIME_INVISIBLE_MS) blinkTimer.restart(); } + + float Chatbar::getHeight() + { + const float fontSize = FONT_SIZE * Settings::getScaling(); + const float fontHeight = ResourceCache::getFont("fonts/Roboto-Regular.ttf")->getLineSpacing(fontSize); + return PADDING_TOP + floor(fontHeight * 1.7f + BOX_PADDING_Y * 2.0f) + PADDING_BOTTOM; + } } |