summaryrefslogtreecommitdiff
path: root/vala/valaproperty.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-04-23 17:12:03 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2018-04-23 19:19:33 +0200
commitac6758f8f8a73e52fb2bec0fbe7eb3d18fc5a09a (patch)
treef763543122ddcde5416b316caeb512775aa9db6b /vala/valaproperty.vala
parent0e03a3327162519e2ce2837f34ff8e102ea256a8 (diff)
downloadvala-ac6758f8f8a73e52fb2bec0fbe7eb3d18fc5a09a.tar.gz
codegen: Support automatic properties as GtkChild
https://bugzilla.gnome.org/show_bug.cgi?id=787034
Diffstat (limited to 'vala/valaproperty.vala')
-rw-r--r--vala/valaproperty.vala5
1 files changed, 5 insertions, 0 deletions
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index 81bb84950..1bc54a532 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -118,6 +118,11 @@ public class Vala.Property : Symbol, Lockable {
_field = new Field ("_%s".printf (name), property_type.copy (), initializer, source_reference);
_field.access = SymbolAccessibility.PRIVATE;
_field.binding = binding;
+ // apply gtk-child attribute to backing field for gtk-template support
+ if (get_attribute ("GtkChild") != null) {
+ _field.set_attribute_string ("GtkChild", "name", get_attribute_string ("GtkChild", "name", name));
+ _field.set_attribute_bool ("GtkChild", "internal", get_attribute_bool ("GtkChild", "internal"));
+ }
}
}
_field_checked = true;