summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-02-26 15:22:30 -0500
committerAndreas Kling <kling@serenityos.org>2022-02-26 22:54:25 +0100
commit5fedb742da8c0d12780ad6f7d30a0484bf928891 (patch)
tree4b614faa4d40bcd229c875a05958d1835f05511e /Userland/Libraries
parent9e81c2dc839e3b6a28037a60065541cb81ef5927 (diff)
downloadserenity-5fedb742da8c0d12780ad6f7d30a0484bf928891.zip
LibGUI: Set Editors to wrap at words when MultiLine
And default to NoWrap when they are type SingleLine.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.cpp4
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp
index 4e23c8cc9f..2020430029 100644
--- a/Userland/Libraries/LibGUI/TextEditor.cpp
+++ b/Userland/Libraries/LibGUI/TextEditor.cpp
@@ -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] {
diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h
index 789188be37..dd64808930 100644
--- a/Userland/Libraries/LibGUI/TextEditor.h
+++ b/Userland/Libraries/LibGUI/TextEditor.h
@@ -347,7 +347,7 @@ private:
bool m_needs_rehighlight { false };
bool m_has_pending_change_notification { false };
bool m_automatic_indentation_enabled { false };
- WrappingMode m_wrapping_mode { WrappingMode::WrapAtWords };
+ WrappingMode m_wrapping_mode { WrappingMode::NoWrap };
bool m_visualize_trailing_whitespace { true };
bool m_visualize_leading_whitespace { false };
bool m_cursor_line_highlighting { true };