Skip to content

Commit eb8c2bd

Browse files
demostanislinusg
authored andcommitted
LibGUI: Don't show the command palette action in the command palette
1 parent 28c1d70 commit eb8c2bd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Userland/Libraries/LibGUI/CommandPalette.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,17 @@ void CommandPalette::collect_actions(GUI::Window& parent_window)
247247
});
248248
};
249249

250+
Function<bool(GUI::Action*)> should_show_action = [&](GUI::Action* action) {
251+
return action && action->is_enabled() && action->shortcut() != Shortcut(Mod_Ctrl | Mod_Shift, Key_A);
252+
};
253+
250254
Function<void(Menu&)> collect_actions_from_menu = [&](Menu& menu) {
251255
for (auto menu_item : menu.items()) {
252256
if (menu_item.submenu())
253257
collect_actions_from_menu(*menu_item.submenu());
254258

255-
auto const* action = menu_item.action();
256-
if (action && action->is_enabled())
259+
auto* action = menu_item.action();
260+
if (should_show_action(action))
257261
actions.set(*action);
258262
}
259263
};
@@ -271,7 +275,7 @@ void CommandPalette::collect_actions(GUI::Window& parent_window)
271275

272276
if (!parent_window.is_modal()) {
273277
for (auto const& it : GUI::Application::the()->global_shortcut_actions({})) {
274-
if (it.value->is_enabled())
278+
if (should_show_action(it.value))
275279
actions.set(*it.value);
276280
}
277281
}

0 commit comments

Comments
 (0)