mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:47:37 +00:00
LibGUI: Add GUI::Toolbar::try_add_action()
This is a fallible variant of add_action() that returns ErrorOr. It's careful to not fail with a partially added action.
This commit is contained in:
parent
47b6339025
commit
9b07e13fb6
2 changed files with 17 additions and 5 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
|
||||
namespace GUI {
|
||||
|
@ -16,6 +17,7 @@ class Toolbar : public Widget {
|
|||
public:
|
||||
virtual ~Toolbar() override;
|
||||
|
||||
ErrorOr<NonnullRefPtr<GUI::Button>> try_add_action(GUI::Action&);
|
||||
GUI::Button& add_action(GUI::Action&);
|
||||
void add_separator();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue