summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-11 14:25:48 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-11 14:26:37 +0200
commit7a2faecc155817adc62d181ddff4179a08bc8b30 (patch)
treea27cff1a4da9b67000aadcce1c7089803e0b4b7d /Libraries/LibGUI
parente2050ea0ce2caed4f81687064d820e8acc08b6f7 (diff)
downloadserenity-7a2faecc155817adc62d181ddff4179a08bc8b30.zip
LibGUI: Use widget override cursors in GUI::TextEditor
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/TextEditor.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp
index 297046c278..cf36a82708 100644
--- a/Libraries/LibGUI/TextEditor.cpp
+++ b/Libraries/LibGUI/TextEditor.cpp
@@ -54,6 +54,7 @@ TextEditor::TextEditor(Type type)
: m_type(type)
{
set_accepts_emoji_input(true);
+ set_override_cursor(Gfx::StandardCursor::IBeam);
set_background_role(ColorRole::Base);
set_foreground_role(ColorRole::BaseText);
set_document(TextDocument::create());
@@ -1341,18 +1342,11 @@ void TextEditor::undefer_reflow()
void TextEditor::enter_event(Core::Event&)
{
- ASSERT(window());
- if (!is_displayonly())
- window()->set_cursor(Gfx::StandardCursor::IBeam);
-
m_automatic_selection_scroll_timer->stop();
}
void TextEditor::leave_event(Core::Event&)
{
- ASSERT(window());
- window()->set_cursor(Gfx::StandardCursor::None);
-
if (m_in_drag_select)
m_automatic_selection_scroll_timer->start();
}
@@ -1398,6 +1392,11 @@ void TextEditor::set_mode(const Mode mode)
default:
ASSERT_NOT_REACHED();
}
+
+ if (!is_displayonly())
+ set_override_cursor(Gfx::StandardCursor::IBeam);
+ else
+ set_override_cursor(Gfx::StandardCursor::None);
}
void TextEditor::set_has_open_button(bool has_button)