diff options
author | Timm Bäder <mail@baedert.org> | 2017-04-27 15:45:08 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2017-04-28 11:27:09 +0200 |
commit | 2a0a87049e3f2032a0f0766059be9f1d7be31fe2 (patch) | |
tree | 8e2042ef22f5adc36f3cd49f40c2a1c69ac3f4ca /gtk | |
parent | 179b8b0cbcf4f2ab66e8771d3296d30668998946 (diff) | |
download | gtk+-2a0a87049e3f2032a0f0766059be9f1d7be31fe2.tar.gz |
headerbar: Compute clip directly
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkheaderbar.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index c2ffe02a93..9aa401f155 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -959,6 +959,7 @@ gtk_header_bar_allocate_contents (GtkCssGadget *gadget, gint x; gint child_size; GtkTextDirection direction; + GtkAllocation child_clip; direction = gtk_widget_get_direction (widget); nvis_children = count_visible_children (bar); @@ -1136,6 +1137,8 @@ gtk_header_bar_allocate_contents (GtkCssGadget *gadget, child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width; gtk_widget_size_allocate (child->widget, &child_allocation); + gtk_widget_get_clip (child->widget, &child_clip); + gdk_rectangle_union (&child_clip, out_clip, out_clip); next: i++; @@ -1171,7 +1174,11 @@ gtk_header_bar_allocate_contents (GtkCssGadget *gadget, child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width; if (title_widget != NULL) - gtk_widget_size_allocate (title_widget, &child_allocation); + { + gtk_widget_size_allocate (title_widget, &child_allocation); + gtk_widget_get_clip (title_widget, &child_clip); + gdk_rectangle_union (&child_clip, out_clip, out_clip); + } child_allocation.y = allocation->y; child_allocation.height = height; @@ -1185,6 +1192,8 @@ gtk_header_bar_allocate_contents (GtkCssGadget *gadget, child_allocation.x = allocation->x + allocation->width - start_width + priv->spacing; child_allocation.width = start_width - priv->spacing; gtk_widget_size_allocate (priv->titlebar_start_box, &child_allocation); + gtk_widget_get_clip (priv->titlebar_start_box, &child_clip); + gdk_rectangle_union (&child_clip, out_clip, out_clip); } if (priv->titlebar_end_box) @@ -1196,9 +1205,9 @@ gtk_header_bar_allocate_contents (GtkCssGadget *gadget, child_allocation.x = allocation->x + allocation->width - end_width + priv->spacing; child_allocation.width = end_width - priv->spacing; gtk_widget_size_allocate (priv->titlebar_end_box, &child_allocation); + gtk_widget_get_clip (priv->titlebar_end_box, &child_clip); + gdk_rectangle_union (&child_clip, out_clip, out_clip); } - - gtk_container_get_children_clip (GTK_CONTAINER (widget), out_clip); } /** |