File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Userland/Libraries/LibGUI Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -247,13 +247,17 @@ void CommandPalette::collect_actions(GUI::Window& parent_window)
247
247
});
248
248
};
249
249
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
+
250
254
Function<void (Menu&)> collect_actions_from_menu = [&](Menu& menu) {
251
255
for (auto menu_item : menu.items ()) {
252
256
if (menu_item.submenu ())
253
257
collect_actions_from_menu (*menu_item.submenu ());
254
258
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 ))
257
261
actions.set (*action);
258
262
}
259
263
};
@@ -271,7 +275,7 @@ void CommandPalette::collect_actions(GUI::Window& parent_window)
271
275
272
276
if (!parent_window.is_modal ()) {
273
277
for (auto const & it : GUI::Application::the ()->global_shortcut_actions ({})) {
274
- if (it.value -> is_enabled ( ))
278
+ if (should_show_action ( it.value ))
275
279
actions.set (*it.value );
276
280
}
277
281
}
You can’t perform that action at this time.
0 commit comments