1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

GTextEditor: Create the "go to line" action eagerly

Previously it was created the first time you requested a context menu
for the GTextEditor by right-clicking in it.

That meant it wasn't possible to use Ctrl+L to "go to line" before you
had first right-clicked the editor.
This commit is contained in:
Andreas Kling 2020-01-23 21:27:27 +01:00
parent a33259483a
commit 1c34348b0c
2 changed files with 15 additions and 11 deletions

View file

@ -124,6 +124,7 @@ public:
GAction& copy_action() { return *m_copy_action; }
GAction& paste_action() { return *m_paste_action; }
GAction& delete_action() { return *m_delete_action; }
GAction& go_to_line_action() { return *m_go_to_line_action; }
void add_custom_context_menu_action(GAction&);
@ -230,6 +231,7 @@ private:
RefPtr<GAction> m_copy_action;
RefPtr<GAction> m_paste_action;
RefPtr<GAction> m_delete_action;
RefPtr<GAction> m_go_to_line_action;
CElapsedTimer m_triple_click_timer;
NonnullRefPtrVector<GAction> m_custom_context_menu_actions;