diff options
author | Tim Ledbetter <timledbetter@gmail.com> | 2023-02-26 23:25:49 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-27 13:37:24 +0100 |
commit | cc4184cb47066a3d849512ade4d1dadde575a51c (patch) | |
tree | 5e59019717d59958e1fcda34cfe75b941dcbd4ec /Userland | |
parent | 5d5f9f52a0cd586fe9ff7ec96c3b5a04d155ae4d (diff) | |
download | serenity-cc4184cb47066a3d849512ade4d1dadde575a51c.zip |
LibGUI: Don't show non-visible actions in CommandPalette
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/CommandPalette.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp index 4bf7c9c5db..7f9bf8de60 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.cpp +++ b/Userland/Libraries/LibGUI/CommandPalette.cpp @@ -232,14 +232,14 @@ void CommandPalette::collect_actions(GUI::Window& parent_window) auto collect_action_children = [&](Core::Object& action_parent) { action_parent.for_each_child_of_type<GUI::Action>([&](GUI::Action& action) { - if (action.is_enabled()) + if (action.is_enabled() && action.is_visible()) actions.set(action); return IterationDecision::Continue; }); }; Function<bool(GUI::Action*)> should_show_action = [&](GUI::Action* action) { - return action && action->is_enabled() && action->shortcut() != Shortcut(Mod_Ctrl | Mod_Shift, Key_A); + return action && action->is_enabled() && action->is_visible() && action->shortcut() != Shortcut(Mod_Ctrl | Mod_Shift, Key_A); }; Function<void(Menu&)> collect_actions_from_menu = [&](Menu& menu) { |