mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
HackStudio: Set proper action scope for editor shortcuts
This fixes issue #14429. The editor actions were not given a parent as scope so defaulted to global. Because HackStudio can have multiple editors and even multiple editor tab widgets, I chose the VerticalSplitter that all editor tab widgets get added to as the parent. With a Widget set as the parent, the action gets WidgetLocal scope and allows the embedded terminals to receive shortcuts. Thanks to Andreas for doing a quick look at this and pointing in the right direction during an Office Hours stream :)
This commit is contained in:
parent
a61a0a63c1
commit
eb9db167da
Notes:
sideshowbarker
2024-07-17 06:02:55 +09:00
Author: https://github.com/tslater2006 Commit: https://github.com/SerenityOS/serenity/commit/eb9db167da Pull-request: https://github.com/SerenityOS/serenity/pull/15429
@ -1257,12 +1257,12 @@ void HackStudioWidget::create_toolbar(GUI::Widget& parent)
|
||||
toolbar.add_action(*m_delete_action);
|
||||
toolbar.add_separator();
|
||||
|
||||
toolbar.add_action(GUI::CommonActions::make_cut_action([this](auto&) { current_editor().cut_action().activate(); }));
|
||||
toolbar.add_action(GUI::CommonActions::make_copy_action([this](auto&) { current_editor().copy_action().activate(); }));
|
||||
toolbar.add_action(GUI::CommonActions::make_paste_action([this](auto&) { current_editor().paste_action().activate(); }));
|
||||
toolbar.add_action(GUI::CommonActions::make_cut_action([this](auto&) { current_editor().cut_action().activate(); }, m_editors_splitter));
|
||||
toolbar.add_action(GUI::CommonActions::make_copy_action([this](auto&) { current_editor().copy_action().activate(); }, m_editors_splitter));
|
||||
toolbar.add_action(GUI::CommonActions::make_paste_action([this](auto&) { current_editor().paste_action().activate(); }, m_editors_splitter));
|
||||
toolbar.add_separator();
|
||||
toolbar.add_action(GUI::CommonActions::make_undo_action([this](auto&) { current_editor().undo_action().activate(); }));
|
||||
toolbar.add_action(GUI::CommonActions::make_redo_action([this](auto&) { current_editor().redo_action().activate(); }));
|
||||
toolbar.add_action(GUI::CommonActions::make_undo_action([this](auto&) { current_editor().undo_action().activate(); }, m_editors_splitter));
|
||||
toolbar.add_action(GUI::CommonActions::make_redo_action([this](auto&) { current_editor().redo_action().activate(); }, m_editors_splitter));
|
||||
toolbar.add_separator();
|
||||
|
||||
toolbar.add_action(*m_build_action);
|
||||
|
Loading…
Reference in New Issue
Block a user