summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/TextEditor.cpp4
-rw-r--r--Libraries/LibGUI/TextEditor.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp
index cdf05d3e88..4fbd98d632 100644
--- a/Libraries/LibGUI/TextEditor.cpp
+++ b/Libraries/LibGUI/TextEditor.cpp
@@ -1152,11 +1152,15 @@ void TextEditor::focusin_event(Core::Event&)
m_cursor_state = true;
update_cursor();
start_timer(500);
+ if (on_focusin)
+ on_focusin();
}
void TextEditor::focusout_event(Core::Event&)
{
stop_timer();
+ if (on_focusout)
+ on_focusout();
}
void TextEditor::timer_event(Core::TimerEvent&)
diff --git a/Libraries/LibGUI/TextEditor.h b/Libraries/LibGUI/TextEditor.h
index 97dc70e02c..86390ada75 100644
--- a/Libraries/LibGUI/TextEditor.h
+++ b/Libraries/LibGUI/TextEditor.h
@@ -94,6 +94,8 @@ public:
Function<void()> on_cursor_change;
Function<void()> on_selection_change;
+ Function<void()> on_focusin;
+ Function<void()> on_focusout;
void set_text(const StringView&);
void scroll_cursor_into_view();