mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibCore: Add new REGISTER_STRING_PROPERTY macro
This commit is contained in:
committed by
Andreas Kling
parent
ee5838084d
commit
858e55b653
Notes:
sideshowbarker
2024-07-17 14:33:07 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/858e55b653 Pull-request: https://github.com/SerenityOS/serenity/pull/17800 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/awesomekling
@@ -28,14 +28,7 @@ AbstractButton::AbstractButton(String text)
|
||||
click();
|
||||
};
|
||||
|
||||
// FIXME: Port JsonValue to the new String class.
|
||||
register_property(
|
||||
"text",
|
||||
[this]() { return this->text().to_deprecated_string(); },
|
||||
[this](auto& value) {
|
||||
this->set_text(String::from_deprecated_string(value.to_deprecated_string()).release_value_but_fixme_should_propagate_errors());
|
||||
return true;
|
||||
});
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_BOOL_PROPERTY("checked", is_checked, set_checked);
|
||||
REGISTER_BOOL_PROPERTY("checkable", is_checkable, set_checkable);
|
||||
REGISTER_BOOL_PROPERTY("exclusive", is_exclusive, set_exclusive);
|
||||
|
||||
Reference in New Issue
Block a user