summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/TextEditor.h
diff options
context:
space:
mode:
authorangel <angel@ttm.sh>2020-04-20 21:10:03 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-20 22:43:40 +0200
commit441c2715bbb50e0063e827ae37c40f58865993d6 (patch)
treeef52dcf5661deab24b3d2aaa2bef34074343cc7f /Libraries/LibGUI/TextEditor.h
parent563a377f6b5da578673f7c645d6f904505148cc1 (diff)
downloadserenity-441c2715bbb50e0063e827ae37c40f58865993d6.zip
LibGUI: Add Select all action to TextEditor
Previously, TextEditor processed the Select all command directly on the keydown event handler. For this reason, WindowManager would not process it as an action for the focused control and an action with the same keyboard shortcut from the parent could override the TextEditor's one even when it is focused. For instance, when pressing Ctrl+A on the FileManager's path bar, all files were selected instead, which is not the expected behavior. Now the Select all command is an actual action on TextEditor, so that WindowManager can process it correctly before any other actions. I also added an icon for it!
Diffstat (limited to 'Libraries/LibGUI/TextEditor.h')
-rw-r--r--Libraries/LibGUI/TextEditor.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibGUI/TextEditor.h b/Libraries/LibGUI/TextEditor.h
index 15bc844973..760c4d4903 100644
--- a/Libraries/LibGUI/TextEditor.h
+++ b/Libraries/LibGUI/TextEditor.h
@@ -121,6 +121,7 @@ public:
Action& paste_action() { return *m_paste_action; }
Action& delete_action() { return *m_delete_action; }
Action& go_to_line_action() { return *m_go_to_line_action; }
+ Action& select_all_action() { return *m_select_all_action; }
void add_custom_context_menu_action(Action&);
@@ -233,6 +234,7 @@ private:
RefPtr<Action> m_paste_action;
RefPtr<Action> m_delete_action;
RefPtr<Action> m_go_to_line_action;
+ RefPtr<Action> m_select_all_action;
Core::ElapsedTimer m_triple_click_timer;
NonnullRefPtrVector<Action> m_custom_context_menu_actions;