diff options
author | Timm Bäder <mail@baedert.org> | 2017-04-24 23:11:15 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2017-04-25 20:30:37 +0200 |
commit | 167fc2b659f781736f93a47697c25a9cf6280e51 (patch) | |
tree | 86de63d98738ea5dcc81db074046184e6b94ae17 /gtk/gtklistbox.c | |
parent | fe429f8806ccc0047d1cac6b27bdd9dc016faddf (diff) | |
download | gtk+-167fc2b659f781736f93a47697c25a9cf6280e51.tar.gz |
listbox: Compute clips directly
Diffstat (limited to 'gtk/gtklistbox.c')
-rw-r--r-- | gtk/gtklistbox.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 01c427fa38..bd4a399c1d 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -2737,7 +2737,7 @@ gtk_list_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkListBoxPrivate *priv = BOX_PRIV (widget); - GtkAllocation clip; + GtkAllocation clip = *allocation; gtk_widget_set_allocation (widget, allocation); @@ -2767,6 +2767,7 @@ gtk_list_box_allocate (GtkCssGadget *gadget, GtkAllocation child_allocation; GtkAllocation header_allocation; GtkAllocation widget_allocation; + GtkAllocation clip; GtkListBoxRow *row; GSequenceIter *iter; int child_min; @@ -2791,6 +2792,8 @@ gtk_list_box_allocate (GtkCssGadget *gadget, header_allocation.height = allocation->height; header_allocation.y = child_allocation.y; gtk_widget_size_allocate (priv->placeholder, &header_allocation); + gtk_widget_get_clip (priv->placeholder, &clip); + gdk_rectangle_union (out_clip, out_clip, &clip); child_allocation.y += child_min; } @@ -2814,6 +2817,8 @@ gtk_list_box_allocate (GtkCssGadget *gadget, header_allocation.height = child_min; header_allocation.y = child_allocation.y; gtk_widget_size_allocate (ROW_PRIV (row)->header, &header_allocation); + gtk_widget_get_clip (ROW_PRIV (row)->header, &clip); + gdk_rectangle_union (out_clip, out_clip, &clip); child_allocation.y += child_min; } @@ -2826,10 +2831,10 @@ gtk_list_box_allocate (GtkCssGadget *gadget, ROW_PRIV (row)->height = child_allocation.height; gtk_widget_size_allocate (GTK_WIDGET (row), &child_allocation); + gtk_widget_get_clip (GTK_WIDGET (row), &clip); + gdk_rectangle_union (out_clip, out_clip, &clip); child_allocation.y += child_min; } - - gtk_container_get_children_clip (GTK_CONTAINER (widget), out_clip); } /** @@ -3355,7 +3360,7 @@ static void gtk_list_box_row_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { - GtkAllocation clip; + GtkAllocation clip = *allocation; gtk_widget_set_allocation (widget, allocation); @@ -3381,9 +3386,10 @@ gtk_list_box_row_allocate (GtkCssGadget *gadget, child = gtk_bin_get_child (GTK_BIN (widget)); if (child && gtk_widget_get_visible (child)) - gtk_widget_size_allocate (child, (GtkAllocation *)allocation); - - gtk_container_get_children_clip (GTK_CONTAINER (widget), out_clip); + { + gtk_widget_size_allocate (child, (GtkAllocation *)allocation); + gtk_widget_get_clip (child, out_clip); + } } /** |