mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibGUI: Add fallible try_create_checkable() Action
This commit is contained in:
parent
032ca748c6
commit
7252a1aa4d
2 changed files with 7 additions and 0 deletions
|
@ -63,6 +63,11 @@ NonnullRefPtr<Action> Action::create_checkable(String text, Shortcut const& shor
|
|||
return adopt_ref(*new Action(move(text), shortcut, Shortcut {}, move(icon), move(callback), parent, true));
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Action>> Action::try_create_checkable(String text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Action(move(text), shortcut, Shortcut {}, move(callback), parent, true));
|
||||
}
|
||||
|
||||
RefPtr<Action> Action::find_action_for_shortcut(Core::Object& object, Shortcut const& shortcut)
|
||||
{
|
||||
RefPtr<Action> found_action = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue