summaryrefslogtreecommitdiff
path: root/gtk/gtkpathbar.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-06-18 12:25:39 +0200
committerMatthias Clasen <mclasen@redhat.com>2017-07-19 21:27:14 -0400
commit6b9d10039d1cb80fc8001f4b330383e8ddf374e8 (patch)
tree05d2962b23660602aa1ca9ae0492aceedae66e1f /gtk/gtkpathbar.c
parentf40c61fb407a7e215e043df3b7ff577c5b258f4a (diff)
downloadgtk+-6b9d10039d1cb80fc8001f4b330383e8ddf374e8.tar.gz
pathbar: Compute widget clip directly
Instead of relying on gtk_widge_set_simple_clip
Diffstat (limited to 'gtk/gtkpathbar.c')
-rw-r--r--gtk/gtkpathbar.c12
1 files changed, 10 insertions, 2 deletions
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