From 6b9d10039d1cb80fc8001f4b330383e8ddf374e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 18 Jun 2017 12:25:39 +0200 Subject: pathbar: Compute widget clip directly Instead of relying on gtk_widge_set_simple_clip --- gtk/gtkpathbar.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gtk/gtkpathbar.c') diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index dd90ee19b4..399bb94f72 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -463,11 +463,13 @@ gtk_path_bar_size_allocate (GtkWidget *widget, gint up_slider_offset = 0; gint down_slider_offset = 0; GtkRequisition child_requisition; + GtkAllocation clip = *allocation; + GtkAllocation child_clip; /* No path is set; we don't have to allocate anything. */ if (path_bar->priv->button_list == NULL) { - _gtk_widget_set_simple_clip (widget, NULL); + gtk_widget_set_clip (widget, allocation); return; } @@ -622,6 +624,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget, gtk_widget_set_child_visible (child, TRUE); gtk_widget_size_allocate (child, &child_allocation); + gtk_widget_get_clip (child, &child_clip); + gdk_rectangle_union (&clip, &child_clip, &clip); if (direction == GTK_TEXT_DIR_RTL) { @@ -651,6 +655,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget, child_allocation.width = path_bar->priv->slider_width; child_allocation.x = up_slider_offset + allocation->x; gtk_widget_size_allocate (path_bar->priv->up_slider_button, &child_allocation); + gtk_widget_get_clip (path_bar->priv->up_slider_button, &child_clip); + gdk_rectangle_union (&clip, &child_clip, &clip); gtk_widget_set_child_visible (path_bar->priv->up_slider_button, TRUE); gtk_widget_show (path_bar->priv->up_slider_button); @@ -669,6 +675,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget, child_allocation.x = down_slider_offset + allocation->x; gtk_widget_size_allocate (path_bar->priv->down_slider_button, &child_allocation); + gtk_widget_get_clip (path_bar->priv->down_slider_button, &child_clip); + gdk_rectangle_union (&clip, &child_clip, &clip); gtk_widget_set_child_visible (path_bar->priv->down_slider_button, TRUE); gtk_widget_show (path_bar->priv->down_slider_button); @@ -679,7 +687,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget, gtk_widget_set_child_visible (path_bar->priv->down_slider_button, FALSE); } - _gtk_widget_set_simple_clip (widget, NULL); + gtk_widget_set_clip (widget, &clip); } static void -- cgit v1.2.1