mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibGUI: Register GUI icon path setters as write-only
The getters passed to REGISTER_STRING_PROPERTY are never invoked. But if they were, they would errantly incur an implicit pointer-to-boolean cast when their return type (Gfx::Bitmap*) is used to construct a JsonValue.
This commit is contained in:
parent
746364d7c1
commit
174062e0c5
Notes:
sideshowbarker
2024-07-17 05:21:12 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/174062e0c5 Pull-request: https://github.com/SerenityOS/serenity/pull/16384
|
@ -42,7 +42,7 @@ Button::Button(DeprecatedString text)
|
|||
{ Gfx::ButtonStyle::Normal, "Normal" },
|
||||
{ Gfx::ButtonStyle::Coolbar, "Coolbar" });
|
||||
|
||||
REGISTER_STRING_PROPERTY("icon", icon, set_icon_from_path);
|
||||
REGISTER_WRITE_ONLY_STRING_PROPERTY("icon", set_icon_from_path);
|
||||
REGISTER_BOOL_PROPERTY("default", is_default, set_default);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ ImageWidget::ImageWidget(StringView)
|
|||
|
||||
REGISTER_BOOL_PROPERTY("auto_resize", auto_resize, set_auto_resize);
|
||||
REGISTER_BOOL_PROPERTY("should_stretch", should_stretch, set_should_stretch);
|
||||
REGISTER_STRING_PROPERTY("bitmap", bitmap, load_from_file);
|
||||
REGISTER_WRITE_ONLY_STRING_PROPERTY("bitmap", load_from_file);
|
||||
}
|
||||
|
||||
void ImageWidget::set_bitmap(Gfx::Bitmap const* bitmap)
|
||||
|
|
|
@ -34,7 +34,7 @@ Label::Label(DeprecatedString text)
|
|||
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_BOOL_PROPERTY("autosize", is_autosize, set_autosize);
|
||||
REGISTER_STRING_PROPERTY("icon", icon, set_icon_from_path);
|
||||
REGISTER_WRITE_ONLY_STRING_PROPERTY("icon", set_icon_from_path);
|
||||
}
|
||||
|
||||
void Label::set_autosize(bool autosize, size_t padding)
|
||||
|
|
Loading…
Reference in a new issue