1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:17:35 +00:00

LibGUI: Share code for finding an Action by Shortcut

This moves logic for finding a shortcut on a Window or Widget to
Action::find_action_for_shortcut instead.
This commit is contained in:
Zaggy1024 2022-10-24 19:04:32 -05:00 committed by Sam Atkins
parent 025c16a6f9
commit 8e7c7e0a2a
4 changed files with 17 additions and 18 deletions

View file

@ -76,6 +76,8 @@ public:
static NonnullRefPtr<Action> create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent = nullptr);
static NonnullRefPtr<Action> create_checkable(String text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap> icon, Function<void(Action&)> callback, Core::Object* parent = nullptr);
static RefPtr<Action> find_action_for_shortcut(Core::Object& object, Shortcut const& shortcut);
virtual ~Action() override;
String text() const { return m_text; }