summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilder.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-12-18 16:47:31 +0100
committerMatthias Clasen <mclasen@redhat.com>2020-05-30 10:46:27 -0400
commit1ef805328fca0abf0841bb15af78c2b752ef7ec1 (patch)
tree38b6e8acc04aa8709213a1fd4d48d36220708d02 /gtk/gtkbuilder.c
parent3a8ebf4c9f7d5202eeb7937371318d5e682151a8 (diff)
downloadgtk+-1ef805328fca0abf0841bb15af78c2b752ef7ec1.tar.gz
builder: Allow <property bind /> for objects
Previously, object properties had to always be set to a value. This now works without it.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r--gtk/gtkbuilder.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index c728ba6116..3f8ba5329e 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -527,7 +527,14 @@ gtk_builder_get_parameters (GtkBuilder *builder,
const char *property_name = g_intern_string (prop->pspec->name);
GValue property_value = G_VALUE_INIT;
- if (G_IS_PARAM_SPEC_OBJECT (prop->pspec) &&
+ if (prop->bound && (!prop->text || prop->text->len == 0))
+ {
+ /* Ignore properties with a binding and no value since they are
+ * only there for to express the binding.
+ */
+ continue;
+ }
+ else if (G_IS_PARAM_SPEC_OBJECT (prop->pspec) &&
(G_PARAM_SPEC_VALUE_TYPE (prop->pspec) != GDK_TYPE_PIXBUF) &&
(G_PARAM_SPEC_VALUE_TYPE (prop->pspec) != GDK_TYPE_TEXTURE) &&
(G_PARAM_SPEC_VALUE_TYPE (prop->pspec) != GDK_TYPE_PAINTABLE) &&
@@ -564,13 +571,6 @@ gtk_builder_get_parameters (GtkBuilder *builder,
continue;
}
}
- else if (prop->bound && (!prop->text || prop->text->len == 0))
- {
- /* Ignore properties with a binding and no value since they are
- * only there for to express the binding.
- */
- continue;
- }
else if (!gtk_builder_value_from_string (builder, prop->pspec,
prop->text->str,
&property_value,