Fix simple bindings with template soure

This commit is contained in:
James Westman 2023-05-16 17:14:34 -05:00
parent 8f3682135b
commit e4bad039b0
4 changed files with 23 additions and 1 deletions

View file

@ -114,7 +114,16 @@ class XmlOutput(OutputFormat):
elif isinstance(value, Binding):
if simple := value.simple_binding:
props["bind-source"] = simple.source
if (
simple.source == "template"
and value.context[ScopeCtx].template is not None
):
props["bind-source"] = value.context[
ScopeCtx
].template.gir_class.glib_type_name
else:
props["bind-source"] = simple.source
props["bind-property"] = simple.property_name
props["bind-flags"] = "sync-create"
xml.put_self_closing("property", **props)