mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibCore+Userland: Add DEPRECATED infix to REGISTER_STRING_PROPERTY macro
This commit is contained in:
parent
f31a9e9374
commit
ee5838084d
|
@ -39,7 +39,7 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget* graph)
|
|||
VERIFY(!s_the);
|
||||
s_the = this;
|
||||
|
||||
REGISTER_STRING_PROPERTY("memory_graph", graph_widget_name, set_graph_widget_via_name);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("memory_graph", graph_widget_name, set_graph_widget_via_name);
|
||||
|
||||
set_fixed_height(110);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
private:
|
||||
UnavailableProcessWidget()
|
||||
{
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("text", text, set_text);
|
||||
}
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent& event) override
|
||||
|
|
|
@ -29,7 +29,7 @@ Object::Object(Object* parent)
|
|||
m_parent->add_child(*this);
|
||||
|
||||
REGISTER_READONLY_STRING_PROPERTY("class_name", class_name);
|
||||
REGISTER_STRING_PROPERTY("name", name, set_name);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("name", name, set_name);
|
||||
|
||||
register_property(
|
||||
"address", [this] { return FlatPtr(this); },
|
||||
|
|
|
@ -295,13 +295,13 @@ requires IsBaseOf<Object, T>
|
|||
return true; \
|
||||
});
|
||||
|
||||
#define REGISTER_STRING_PROPERTY(property_name, getter, setter) \
|
||||
register_property( \
|
||||
property_name, \
|
||||
[this] { return this->getter(); }, \
|
||||
[this](auto& value) { \
|
||||
this->setter(value.to_deprecated_string()); \
|
||||
return true; \
|
||||
#define REGISTER_DEPRECATED_STRING_PROPERTY(property_name, getter, setter) \
|
||||
register_property( \
|
||||
property_name, \
|
||||
[this] { return this->getter(); }, \
|
||||
[this](auto& value) { \
|
||||
this->setter(value.to_deprecated_string()); \
|
||||
return true; \
|
||||
});
|
||||
|
||||
#define REGISTER_READONLY_STRING_PROPERTY(property_name, getter) \
|
||||
|
|
|
@ -26,7 +26,7 @@ ColorInput::ColorInput()
|
|||
set_color_internal(parsed_color.value(), AllowCallback::Yes, false);
|
||||
};
|
||||
|
||||
REGISTER_STRING_PROPERTY("color_picker_title", color_picker_title, set_color_picker_title);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("color_picker_title", color_picker_title, set_color_picker_title);
|
||||
REGISTER_BOOL_PROPERTY("has_alpha_channel", has_alpha_channel, set_color_has_alpha_channel);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ private:
|
|||
|
||||
ComboBox::ComboBox()
|
||||
{
|
||||
REGISTER_STRING_PROPERTY("placeholder", editor_placeholder, set_editor_placeholder);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("placeholder", editor_placeholder, set_editor_placeholder);
|
||||
REGISTER_BOOL_PROPERTY("model_only", only_allow_values_from_model, set_only_allow_values_from_model);
|
||||
REGISTER_INT_PROPERTY("max_visible_items", max_visible_items, set_max_visible_items);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace GUI {
|
|||
GroupBox::GroupBox(StringView title)
|
||||
: m_title(title)
|
||||
{
|
||||
REGISTER_STRING_PROPERTY("title", title, set_title);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("title", title, set_title);
|
||||
}
|
||||
|
||||
Margins GroupBox::content_margins() const
|
||||
|
|
|
@ -31,7 +31,7 @@ Label::Label(DeprecatedString text)
|
|||
|
||||
set_foreground_role(Gfx::ColorRole::WindowText);
|
||||
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_BOOL_PROPERTY("autosize", is_autosize, set_autosize);
|
||||
REGISTER_WRITE_ONLY_STRING_PROPERTY("icon", set_icon_from_path);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace GUI {
|
|||
Progressbar::Progressbar(Orientation orientation)
|
||||
: m_orientation(orientation)
|
||||
{
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_ENUM_PROPERTY("format", format, set_format, Format,
|
||||
{ Format::NoText, "NoText" },
|
||||
{ Format::Percentage, "Percentage" },
|
||||
|
|
|
@ -25,7 +25,7 @@ Statusbar::Statusbar(int count)
|
|||
m_corner = add<ResizeCorner>();
|
||||
set_segment_count(count);
|
||||
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_INT_PROPERTY("segment_count", segment_count, set_segment_count);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ static constexpr StringView folded_region_summary_text = " ..."sv;
|
|||
TextEditor::TextEditor(Type type)
|
||||
: m_type(type)
|
||||
{
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_STRING_PROPERTY("placeholder", placeholder, set_placeholder);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("text", text, set_text);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("placeholder", placeholder, set_placeholder);
|
||||
REGISTER_BOOL_PROPERTY("gutter", is_gutter_visible, set_gutter_visible);
|
||||
REGISTER_BOOL_PROPERTY("ruler", is_ruler_visible, set_ruler_visible);
|
||||
REGISTER_ENUM_PROPERTY("mode", mode, set_mode, Mode,
|
||||
|
|
|
@ -47,7 +47,7 @@ Widget::Widget()
|
|||
REGISTER_BOOL_PROPERTY("visible", is_visible, set_visible);
|
||||
REGISTER_BOOL_PROPERTY("focused", is_focused, set_focus);
|
||||
REGISTER_BOOL_PROPERTY("enabled", is_enabled, set_enabled);
|
||||
REGISTER_STRING_PROPERTY("tooltip", tooltip, set_tooltip);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("tooltip", tooltip, set_tooltip);
|
||||
|
||||
REGISTER_UI_SIZE_PROPERTY("min_size", min_size, set_min_size);
|
||||
REGISTER_READONLY_UI_SIZE_PROPERTY("effective_min_size", effective_min_size);
|
||||
|
@ -72,11 +72,11 @@ Widget::Widget()
|
|||
REGISTER_INT_PROPERTY("x", x, set_x);
|
||||
REGISTER_INT_PROPERTY("y", y, set_y);
|
||||
|
||||
REGISTER_STRING_PROPERTY("font", m_font->family, set_font_family);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("font", m_font->family, set_font_family);
|
||||
REGISTER_INT_PROPERTY("font_size", m_font->presentation_size, set_font_size);
|
||||
REGISTER_FONT_WEIGHT_PROPERTY("font_weight", m_font->weight, set_font_weight);
|
||||
|
||||
REGISTER_STRING_PROPERTY("title", title, set_title);
|
||||
REGISTER_DEPRECATED_STRING_PROPERTY("title", title, set_title);
|
||||
|
||||
register_property(
|
||||
"font_type", [this] { return m_font->is_fixed_width() ? "FixedWidth" : "Normal"; },
|
||||
|
|
Loading…
Reference in a new issue