Support template without parent

This commit is contained in:
Sonny Piers 2024-06-16 15:23:48 +02:00 committed by Sonny Piers
parent 896dd7f824
commit adc2be1454
5 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
template $TestTemplate {
test-property: 'Hello, world';
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT EDIT!
This file was @generated by blueprint-compiler. Instead, edit the
corresponding .blp file and regenerate this file with blueprint-compiler.
-->
<interface>
<requires lib="gtk" version="4.0"/>
<template class="TestTemplate">
<property name="test-property">Hello, world</property>
</template>
</interface>

View file

@ -186,6 +186,7 @@ class TestSamples(unittest.TestCase):
"template_bind_property",
"template_id",
"template_no_parent",
"template_orphan",
"template_simple_binding",
"typeof",
"unchecked_class",
@ -235,6 +236,7 @@ class TestSamples(unittest.TestCase):
self.assert_decompile("strings_dec")
self.assert_decompile("style_dec")
self.assert_decompile("template")
self.assert_decompile("template_orphan")
self.assert_decompile("translated")
self.assert_decompile("using")
self.assert_decompile("unchecked_class_dec")