diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-08 03:13:57 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-04-26 17:59:41 +0200 |
commit | 9c0acf62b47102e3b16b29839516f8528f5590d3 (patch) | |
tree | 0b8583dc2f6dd51aaac68569dad7da39da530a18 /gtk/gtkheaderbar.c | |
parent | 9af03fa602b8b0cd72572c64e2e8ed3e63ede03f (diff) | |
download | gtk+-9c0acf62b47102e3b16b29839516f8528f5590d3.tar.gz |
widget: Allow adding event controllers in ui files
Diffstat (limited to 'gtk/gtkheaderbar.c')
-rw-r--r-- | gtk/gtkheaderbar.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index c5e3d5c8d8..6c42ebb845 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -1988,6 +1988,8 @@ gtk_header_bar_init (GtkHeaderBar *bar) construct_label_box (bar); } +static GtkBuildableIface *parent_buildable_iface; + static void gtk_header_bar_buildable_add_child (GtkBuildable *buildable, GtkBuilder *builder, @@ -1996,15 +1998,15 @@ gtk_header_bar_buildable_add_child (GtkBuildable *buildable, { if (type && strcmp (type, "title") == 0) gtk_header_bar_set_custom_title (GTK_HEADER_BAR (buildable), GTK_WIDGET (child)); - else if (!type) - gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child)); else - GTK_BUILDER_WARN_INVALID_CHILD_TYPE (GTK_HEADER_BAR (buildable), type); + parent_buildable_iface->add_child (buildable, builder, child, type); } static void gtk_header_bar_buildable_init (GtkBuildableIface *iface) { + parent_buildable_iface = g_type_interface_peek_parent (iface); + iface->add_child = gtk_header_bar_buildable_add_child; } |