mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
WIP: Add AdwMessageDialog support
Support AdwMessageDialog's custom XML.
This commit is contained in:
parent
08da6f79c7
commit
c5aeb9a16f
8 changed files with 156 additions and 0 deletions
|
@ -32,6 +32,9 @@ class BaseAttribute(AstNode):
|
|||
def name(self):
|
||||
return self.tokens["name"]
|
||||
|
||||
def extra_attributes(self):
|
||||
return {}
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
value = self.children[Value][0]
|
||||
attrs = { self.attr_name: self.name }
|
||||
|
@ -39,6 +42,8 @@ class BaseAttribute(AstNode):
|
|||
if isinstance(value, TranslatedStringValue):
|
||||
attrs = { **attrs, **value.attrs }
|
||||
|
||||
attrs = { **attrs, **self.extra_attributes() }
|
||||
|
||||
xml.start_tag(self.tag_name, **attrs)
|
||||
value.emit_xml(xml)
|
||||
xml.end_tag()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue