summaryrefslogtreecommitdiff
path: root/Userland/Applications/FontEditor
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-07-05 05:48:40 -0400
committerAndreas Kling <kling@serenityos.org>2022-07-06 14:25:30 +0200
commit2227f8f8ae7b57b6451a0b3982d4f83ae2919118 (patch)
treebc8f6ea33188f7b27e1937589e6819339efc6ec8 /Userland/Applications/FontEditor
parentdc3ee84acac1c5269c8caa15aee0fcdec0a53196 (diff)
downloadserenity-2227f8f8ae7b57b6451a0b3982d4f83ae2919118.zip
FontEditor: Simplify GlyphMapWidget context menu construction
Diffstat (limited to 'Userland/Applications/FontEditor')
-rw-r--r--Userland/Applications/FontEditor/FontEditor.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp
index d263299d3e..1480be6841 100644
--- a/Userland/Applications/FontEditor/FontEditor.cpp
+++ b/Userland/Applications/FontEditor/FontEditor.cpp
@@ -421,17 +421,6 @@ FontEditorWidget::FontEditorWidget()
};
m_glyph_map_widget->on_context_menu_request = [this](auto& event) {
- if (!m_context_menu) {
- m_context_menu = GUI::Menu::construct();
- m_context_menu->add_action(*m_cut_action);
- m_context_menu->add_action(*m_copy_action);
- m_context_menu->add_action(*m_paste_action);
- m_context_menu->add_action(*m_delete_action);
- m_context_menu->add_separator();
- m_context_menu->add_action(*m_select_all_action);
- m_context_menu->add_separator();
- m_context_menu->add_action(*m_copy_text_action);
- }
m_context_menu->popup(event.screen_position());
};
@@ -649,6 +638,8 @@ ErrorOr<void> FontEditorWidget::initialize_menubar(GUI::Window& window)
TRY(edit_menu->try_add_separator());
TRY(edit_menu->try_add_action(*m_copy_text_action));
+ m_context_menu = edit_menu;
+
auto go_menu = TRY(window.try_add_menu("&Go"));
TRY(go_menu->try_add_action(*m_previous_glyph_action));
TRY(go_menu->try_add_action(*m_next_glyph_action));