1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:07:34 +00:00

Chess: Move ChessWidget to the create pattern

This commit is contained in:
Lucas CHOLLET 2023-01-07 11:06:32 -05:00 committed by Sam Atkins
parent f66098ab6f
commit e7377c6d60
2 changed files with 9 additions and 4 deletions

View file

@ -19,9 +19,12 @@
#include <LibGfx/Path.h>
#include <unistd.h>
ChessWidget::ChessWidget()
ErrorOr<NonnullRefPtr<ChessWidget>> ChessWidget::try_create()
{
set_piece_set("stelar7"sv);
auto widget = TRY(AK::adopt_nonnull_ref_or_enomem(new (nothrow) ChessWidget));
widget->set_piece_set("stelar7"sv);
return widget;
}
void ChessWidget::paint_event(GUI::PaintEvent& event)