diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-06-10 18:01:59 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-06-11 14:52:30 -0400 |
commit | 21a5c7f0eb39066a64e92007ac7c1466629d0af6 (patch) | |
tree | bab22695373e2fce9aa6acc40e5924092081bcb0 /gtk/gtklayoutmanager.c | |
parent | f03c7c379a7ddb8458fe13954e0979b9afd52841 (diff) | |
download | gtk+-21a5c7f0eb39066a64e92007ac7c1466629d0af6.tar.gz |
layout managers: Handle native children
Add a convenience api to skip children
that should not be included in the layout,
and call gtk_native_check_resize on all
native children outside of the vfunc.
Diffstat (limited to 'gtk/gtklayoutmanager.c')
-rw-r--r-- | gtk/gtklayoutmanager.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtklayoutmanager.c b/gtk/gtklayoutmanager.c index 1325c339ba..c41a604b99 100644 --- a/gtk/gtklayoutmanager.c +++ b/gtk/gtklayoutmanager.c @@ -76,6 +76,7 @@ #include "gtklayoutmanagerprivate.h" #include "gtklayoutchild.h" #include "gtkwidgetprivate.h" +#include "gtknative.h" #ifdef G_ENABLE_DEBUG #define LAYOUT_MANAGER_WARN_NOT_IMPLEMENTED(m,method) G_STMT_START { \ @@ -293,6 +294,20 @@ gtk_layout_manager_measure (GtkLayoutManager *manager, *natural_baseline = nat_baseline; } +static void +allocate_native_children (GtkWidget *widget) +{ + GtkWidget *child; + + for (child = _gtk_widget_get_first_child (widget); + child != NULL; + child = _gtk_widget_get_next_sibling (child)) + { + if (GTK_IS_NATIVE (child)) + gtk_native_check_resize (GTK_NATIVE (child)); + } +} + /** * gtk_layout_manager_allocate: * @manager: a #GtkLayoutManager @@ -318,6 +333,8 @@ gtk_layout_manager_allocate (GtkLayoutManager *manager, g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (baseline >= -1); + allocate_native_children (widget); + klass = GTK_LAYOUT_MANAGER_GET_CLASS (manager); klass->allocate (manager, widget, width, height, baseline); |