1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

GTextEditor: Relayout when the line-wrapping setting is changed

This commit is contained in:
Andreas Kling 2019-08-25 12:23:14 +02:00
parent 453ca65a96
commit 5aac652b4b
2 changed files with 12 additions and 1 deletions

View file

@ -1405,3 +1405,14 @@ void GTextEditor::Line::for_each_visual_line(Callback callback) const
++line_index;
}
}
void GTextEditor::set_line_wrapping_enabled(bool enabled)
{
if (m_line_wrapping_enabled == enabled)
return;
m_line_wrapping_enabled = enabled;
update_content_size();
recompute_all_visual_lines();
update();
}

View file

@ -102,7 +102,7 @@ public:
void set_automatic_indentation_enabled(bool enabled) { m_automatic_indentation_enabled = enabled; }
bool is_line_wrapping_enabled() const { return m_line_wrapping_enabled; }
void set_line_wrapping_enabled(bool enabled) { m_line_wrapping_enabled = enabled; }
void set_line_wrapping_enabled(bool);
TextAlignment text_alignment() const { return m_text_alignment; }
void set_text_alignment(TextAlignment);