1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibGUI: Port rest of the classes to property deserializers

This commit is contained in:
Dan Klishch 2023-11-05 19:29:02 -05:00 committed by Andrew Kaster
parent bd56d2f508
commit 1f4b15dcaa
9 changed files with 164 additions and 211 deletions

View file

@ -37,18 +37,7 @@ TabWidget::TabWidget()
{ TabPosition::Bottom, "Bottom" },
{ TabPosition::Left, "Left" },
{ TabPosition::Right, "Right" }, );
register_property(
"text_alignment",
[this] { return Gfx::to_string(text_alignment()); },
[this](auto& value) {
auto alignment = Gfx::text_alignment_from_string(value.to_byte_string());
if (alignment.has_value()) {
set_text_alignment(alignment.value());
return true;
}
return false;
});
REGISTER_TEXT_ALIGNMENT_PROPERTY("text_alignment", text_alignment, set_text_alignment);
}
ErrorOr<void> TabWidget::try_add_widget(Widget& widget)