HexEditor: Add menu icons for search menu items

This commit is contained in:
Brendan Coles 2021-02-23 12:15:13 +00:00 committed by Andreas Kling
parent 7c2754c3a6
commit a032c836c4
Notes: sideshowbarker 2024-07-18 21:59:43 +09:00

View file

@ -191,7 +191,7 @@ HexEditorWidget::HexEditorWidget()
}
auto& search_menu = menubar->add_menu("Search");
search_menu.add_action(GUI::Action::create("Find", { Mod_Ctrl, Key_F }, [&](const GUI::Action&) {
search_menu.add_action(GUI::Action::create("Find", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"), [&](const GUI::Action&) {
auto old_buffer = m_search_buffer.isolated_copy();
if (FindDialog::show(window(), m_search_text, m_search_buffer) == GUI::InputBox::ExecOK) {
@ -211,7 +211,7 @@ HexEditorWidget::HexEditorWidget()
}
}));
search_menu.add_action(GUI::Action::create("Find", { Mod_None, Key_F3 }, [&](const GUI::Action&) {
search_menu.add_action(GUI::Action::create("Find next", { Mod_None, Key_F3 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find-next.png"), [&](const GUI::Action&) {
if (m_search_text.is_empty() || m_search_buffer.is_empty() || m_search_buffer.is_null()) {
GUI::MessageBox::show(window(), "Nothing to search for", "Not found", GUI::MessageBox::Type::Warning);
return;