mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
FontEditor: Simplify GlyphMapWidget context menu construction
This commit is contained in:
parent
dc3ee84aca
commit
2227f8f8ae
1 changed files with 2 additions and 11 deletions
|
@ -421,17 +421,6 @@ FontEditorWidget::FontEditorWidget()
|
||||||
};
|
};
|
||||||
|
|
||||||
m_glyph_map_widget->on_context_menu_request = [this](auto& event) {
|
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());
|
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_separator());
|
||||||
TRY(edit_menu->try_add_action(*m_copy_text_action));
|
TRY(edit_menu->try_add_action(*m_copy_text_action));
|
||||||
|
|
||||||
|
m_context_menu = edit_menu;
|
||||||
|
|
||||||
auto go_menu = TRY(window.try_add_menu("&Go"));
|
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_previous_glyph_action));
|
||||||
TRY(go_menu->try_add_action(*m_next_glyph_action));
|
TRY(go_menu->try_add_action(*m_next_glyph_action));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue