LibGUI: Set Editors to wrap at words when MultiLine

And default to NoWrap when they are type SingleLine.
This commit is contained in:
thankyouverycool 2022-02-26 15:22:30 -05:00 committed by Andreas Kling
commit 5fedb742da
Notes: sideshowbarker 2024-07-17 18:11:26 +09:00
2 changed files with 4 additions and 2 deletions

View file

@ -57,8 +57,10 @@ TextEditor::TextEditor(Type type)
if (is_single_line())
set_visualize_trailing_whitespace(false);
set_scrollbars_enabled(is_multi_line());
if (is_multi_line())
if (is_multi_line()) {
set_font(Gfx::FontDatabase::default_fixed_width_font());
set_wrapping_mode(WrappingMode::WrapAtWords);
}
vertical_scrollbar().set_step(line_height());
m_cursor = { 0, 0 };
m_automatic_selection_scroll_timer = add<Core::Timer>(100, [this] {