builder-tool: Translate GtkImage:pixbuf

The pixbuf property doesn't exist anymore. It is
commonly set to a path in ui files, so translate it
to the file property.
This commit is contained in:
Matthias Clasen
2021-01-27 17:01:51 -05:00
parent b85296bc98
commit 0240db060a
3 changed files with 24 additions and 1 deletions

View File

@@ -719,7 +719,8 @@ maybe_rename_property (Element *element, MyParserData *data)
{ "GtkWidget", "margin-right", GTK_TYPE_WIDGET, PROP_KIND_OBJECT, "margin-end", { NULL, NULL, NULL } },
{ "GtkHeaderBar", "show-close-button", GTK_TYPE_HEADER_BAR, PROP_KIND_OBJECT, "show-title-buttons", { NULL, NULL, NULL } },
{ "GtkHeaderBar", "custom-title", GTK_TYPE_HEADER_BAR, PROP_KIND_OBJECT, "title-widget", { NULL, NULL, NULL } },
{ "GtkStack", "homogeneous", GTK_TYPE_STACK, PROP_KIND_OBJECT, "hhomogeneous", { "vhomogeneous", NULL, NULL } }
{ "GtkStack", "homogeneous", GTK_TYPE_STACK, PROP_KIND_OBJECT, "hhomogeneous", { "vhomogeneous", NULL, NULL } },
{ "GtkImage", "pixbuf", GTK_TYPE_IMAGE, PROP_KIND_OBJECT, "file", { NULL, NULL, NULL } },
};
int i, k, l;
PropKind kind;

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkWindow">
<property name="child">
<object class="GtkImage">
<property name="visible">0</property>
<property name="file">test.svg</property>
</object>
</property>
</object>
</interface>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<child>
<object class="GtkImage">
<property name="pixbuf">test.svg</property>
</object>
</child>
</object>
</interface>