1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 17:55:07 +00:00

FileManager: Use a GTextEditor for the location bar + tweak icons.

This commit is contained in:
Andreas Kling 2019-03-20 18:12:56 +01:00
parent 367bb9e4eb
commit daa1dcb5e8
6 changed files with 14 additions and 7 deletions

View file

@ -26,6 +26,9 @@ GTextEditor::~GTextEditor()
void GTextEditor::set_text(const String& text)
{
if (is_single_line() && text.length() == m_lines[0]->length() && !memcmp(text.characters(), m_lines[0]->characters(), text.length()))
return;
m_lines.clear();
int start_of_current_line = 0;
@ -44,7 +47,10 @@ void GTextEditor::set_text(const String& text)
}
add_line(i);
update_content_size();
set_cursor(0, 0);
if (is_single_line())
set_cursor(0, m_lines[0]->length());
else
set_cursor(0, 0);
update();
}