tests: Test XML outputs

Load the outputs of the tests in Gtk.Builder and make sure they work.
Some of them don't and need to be fixed. Others will require a bit more
work to set up callbacks, templates, etc.
This commit is contained in:
James Westman 2022-12-19 13:53:52 -06:00
parent 219891584c
commit 8758bac40a
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
7 changed files with 46 additions and 24 deletions

View file

@ -1,6 +1,6 @@
using Gtk 4.0;
template MyDialog : Dialog {
Dialog {
[action response=cancel]
Button cancel_button {
label: _("Cancel");

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="MyDialog" parent="GtkDialog">
<object class="GtkDialog">
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="true">Cancel</property>
@ -22,7 +22,7 @@
<action-widget response="9">custom_response_button</action-widget>
<action-widget response="ok" default="True">ok_button</action-widget>
</action-widgets>
</template>
</object>
<object class="GtkInfoBar">
<child type="action">
<object class="GtkButton" id="ok_info_button">

View file

@ -2,6 +2,7 @@ using Gtk 4.0;
Gtk.Label {
xalign: .5;
margin-end: 1_000_000;
height-request: 1_000_000;
margin-top: 0x30;
}

View file

@ -3,7 +3,7 @@
<requires lib="gtk" version="4.0"/>
<object class="GtkLabel">
<property name="xalign">0.5</property>
<property name="margin-end">1000000</property>
<property name="height-request">1000000</property>
<property name="margin-top">48</property>
</object>
</interface>

View file

@ -1,7 +1,7 @@
using Gtk 4.0;
template TestTemplate : Label {
test-property: Button {
label: "Hello, world!";
Range {
adjustment: Adjustment {
lower: 10;
};
}

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="TestTemplate" parent="GtkLabel">
<property name="test-property">
<object class="GtkButton">
<property name="label">Hello, world!</property>
<object class="GtkRange">
<property name="adjustment">
<object class="GtkAdjustment">
<property name="lower">10</property>
</object>
</property>
</template>
</object>
</interface>