summaryrefslogtreecommitdiff
path: root/LibGUI/GTextEditor.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-15 02:39:58 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-15 02:39:58 +0200
commitad731cc08f2cf84ec5fca5b1cf303fa0ac3cd390 (patch)
tree2a8a7e7bcbd269da0d3b16683189652e74a924a7 /LibGUI/GTextEditor.cpp
parent01ffcdfa31ba560fcceee82ba2158f867ad114ec (diff)
downloadserenity-ad731cc08f2cf84ec5fca5b1cf303fa0ac3cd390.zip
LibGUI: Support cycling through focusable widgets with Tab and Shift-Tab.
Diffstat (limited to 'LibGUI/GTextEditor.cpp')
-rw-r--r--LibGUI/GTextEditor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/LibGUI/GTextEditor.cpp b/LibGUI/GTextEditor.cpp
index 2af1593994..0b11e1ded0 100644
--- a/LibGUI/GTextEditor.cpp
+++ b/LibGUI/GTextEditor.cpp
@@ -315,6 +315,9 @@ void GTextEditor::toggle_selection_if_needed_for_event(const GKeyEvent& event)
void GTextEditor::keydown_event(GKeyEvent& event)
{
+ if (is_single_line() && event.key() == KeyCode::Key_Tab)
+ return GWidget::keydown_event(event);
+
if (event.key() == KeyCode::Key_Escape) {
if (on_escape_pressed)
on_escape_pressed();
@@ -505,8 +508,6 @@ void GTextEditor::keydown_event(GKeyEvent& event)
if (!is_readonly() && !event.ctrl() && !event.alt() && !event.text().is_empty())
insert_at_cursor_or_replace_selection(event.text());
-
- return GWidget::keydown_event(event);
}
void GTextEditor::delete_current_line()