summaryrefslogtreecommitdiff
path: root/gtk/gtkwidget.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-08-20 23:49:00 +0200
committerBenjamin Otte <otte@redhat.com>2014-08-21 00:54:07 +0200
commitb5a8b7ef3b15c2bc264118294895202a16641168 (patch)
tree77210b305af28dabcba7b635888771411b355263 /gtk/gtkwidget.c
parente643ddfd168f81d80400cf67a0ff4b8808ea043c (diff)
downloadgtk+-b5a8b7ef3b15c2bc264118294895202a16641168.tar.gz
widget: Make _gtk_set_simple_clip() take an optional content clip
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r--gtk/gtkwidget.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 383728d0b5..cb9727baa4 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15548,6 +15548,8 @@ union_with_clip (GtkWidget *widget,
/*
* _gtk_widget_set_simple_clip:
* @widget: a #GtkWidget
+ * @content_clip: Clipping area of the contents or %NULL, if the contents
+ * do not extent the allocation.
*
* This is a convenience function for gtk_widget_set_clip(), if you
* just want to set the clip for @widget based on its allocation,
@@ -15562,7 +15564,8 @@ union_with_clip (GtkWidget *widget,
* function and must call gtk_widget_set_clip() yourself.
**/
void
-_gtk_widget_set_simple_clip (GtkWidget *widget)
+_gtk_widget_set_simple_clip (GtkWidget *widget,
+ GtkAllocation *content_clip)
{
GtkStyleContext *context;
GtkAllocation clip;
@@ -15580,6 +15583,9 @@ _gtk_widget_set_simple_clip (GtkWidget *widget)
clip.width += extents.left + extents.right;
clip.height += extents.top + extents.bottom;
+ if (content_clip)
+ gdk_rectangle_union (content_clip, &clip, &clip);
+
if (GTK_IS_CONTAINER (widget))
gtk_container_forall (GTK_CONTAINER (widget), union_with_clip, &clip);