summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-08 13:51:57 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-08 17:55:40 +0300
commit9247c5a23757e01ef7ee91dd5655fcab177e5e6d (patch)
tree38e947cdaa6f1ec33651560b81851b7a255a58ac /src/gui/widgets/textbox.cpp
parentfcf53dd7d524c2204f39269be5768a1919daef42 (diff)
downloadmv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.gz
mv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.bz2
mv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.xz
mv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.zip
fix code style.
Diffstat (limited to 'src/gui/widgets/textbox.cpp')
-rw-r--r--src/gui/widgets/textbox.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index a00d0ccf8..5f565259b 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -65,8 +65,6 @@
#include "gui/widgets/textbox.h"
-#include "events/keyevent.h"
-
#include "input/keydata.h"
#include "gui/font.h"
@@ -567,16 +565,13 @@ void TextBox::setCaretRowColumn(const int row, const int column)
void TextBox::scrollToCaret()
{
+ const Font *const font = getFont();
Rect scroll;
- Font *const font = getFont();
- scroll.x = font->getWidth(
- mTextRows[mCaretRow].substr(0, mCaretColumn));
+ scroll.x = font->getWidth(mTextRows[mCaretRow].substr(0, mCaretColumn));
scroll.y = font->getHeight() * mCaretRow;
scroll.width = font->getWidth(" ");
-
// add 2 for some extra space
scroll.height = font->getHeight() + 2;
-
showPart(scroll);
}
@@ -619,7 +614,7 @@ void TextBox::drawCaret(Graphics *const graphics, const int x, const int y)
void TextBox::adjustSize()
{
int width = 0;
- Font *const font = getFont();
+ const Font *const font = getFont();
for (size_t i = 0, sz = mTextRows.size(); i < sz; ++i)
{
const int w = font->getWidth(mTextRows[i]);