mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
VisualBuilder: Hook up everything needed for widget property editing.
It's now possible to edit widget properties inline in the properties window. We're currently relying on the basic GVariant conversion functions to do all the "parsing" but that's not gonna be good enough.
This commit is contained in:
@@ -73,16 +73,16 @@ static GWidget* build_gwidget(VBWidgetType type, GWidget* parent)
|
||||
}
|
||||
}
|
||||
|
||||
GWidget* VBWidgetRegistry::build_gwidget(VBWidgetType type, GWidget* parent, Vector<OwnPtr<VBProperty>>& properties)
|
||||
GWidget* VBWidgetRegistry::build_gwidget(VBWidget& widget, VBWidgetType type, GWidget* parent, Vector<OwnPtr<VBProperty>>& properties)
|
||||
{
|
||||
auto* gwidget = ::build_gwidget(type, parent);
|
||||
auto add_readonly_property = [&properties] (const String& name, const GVariant& value) {
|
||||
auto property = make<VBProperty>(name, value);
|
||||
auto add_readonly_property = [&] (const String& name, const GVariant& value) {
|
||||
auto property = make<VBProperty>(widget, name, value);
|
||||
property->set_readonly(true);
|
||||
properties.append(move(property));
|
||||
};
|
||||
auto add_property = [&properties] (const String& name, Function<GVariant(const GWidget&)>&& getter, Function<void(GWidget&, const GVariant&)>&& setter) {
|
||||
auto property = make<VBProperty>(name, move(getter), move(setter));
|
||||
auto add_property = [&] (const String& name, Function<GVariant(const GWidget&)>&& getter, Function<void(GWidget&, const GVariant&)>&& setter) {
|
||||
auto property = make<VBProperty>(widget, name, move(getter), move(setter));
|
||||
properties.append(move(property));
|
||||
};
|
||||
add_readonly_property("class", to_class_name(type));
|
||||
|
||||
Reference in New Issue
Block a user