summaryrefslogtreecommitdiff
path: root/gtk/gtkframe.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-07-11 09:58:21 +0200
committerMatthias Clasen <mclasen@redhat.com>2017-07-19 21:27:16 -0400
commit36ab70ddf5dbe993eb995bd9157f347258765922 (patch)
tree508f0ca9cf6b4fc990e88b0a5892b50f594890fe /gtk/gtkframe.c
parent95bd58ac00ede771ca80684e143fffdc61ff2194 (diff)
downloadgtk+-36ab70ddf5dbe993eb995bd9157f347258765922.tar.gz
widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well change the size-allocate signature to include a out_clip parameter, just like GtkCssGadget did. And since we now always propagate baselines, we might as well pass that one on to size-allocate. This way we can also make sure to transform the clip returned from size-allocate to parent-coordinates, i.e. the same coordinate space priv->allocation is in.
Diffstat (limited to 'gtk/gtkframe.c')
-rw-r--r--gtk/gtkframe.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index ff59bac030..2bfa6cf67c 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -117,8 +117,10 @@ static void gtk_frame_get_property (GObject *object,
guint param_id,
GValue *value,
GParamSpec *pspec);
-static void gtk_frame_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
+static void gtk_frame_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip);
static void gtk_frame_remove (GtkContainer *container,
GtkWidget *child);
static void gtk_frame_forall (GtkContainer *container,
@@ -611,15 +613,16 @@ gtk_frame_get_shadow_type (GtkFrame *frame)
}
static void
-gtk_frame_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
+gtk_frame_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip)
{
GtkFrame *frame = GTK_FRAME (widget);
GtkFramePrivate *priv = frame->priv;
GtkWidget *child;
GtkAllocation new_allocation;
- GtkAllocation clip = *allocation;
- GtkAllocation child_clip = *allocation;
+ GtkAllocation child_clip;
gtk_frame_compute_child_allocation (frame, &new_allocation);
priv->child_allocation = new_allocation;
@@ -646,20 +649,16 @@ gtk_frame_size_allocate (GtkWidget *widget,
priv->label_allocation.height = height;
priv->label_allocation.width = width;
- gtk_widget_size_allocate (priv->label_widget, &priv->label_allocation);
- gtk_widget_get_clip (priv->label_widget, &child_clip);
- gdk_rectangle_union (&child_clip, &clip, &clip);
+ gtk_widget_size_allocate (priv->label_widget, &priv->label_allocation, -1, &child_clip);
+ gdk_rectangle_union (out_clip, &child_clip, out_clip);
}
child = gtk_bin_get_child (GTK_BIN (widget));
if (child && gtk_widget_get_visible (child))
{
- gtk_widget_size_allocate (child, &priv->child_allocation);
- gtk_widget_get_clip (child, &child_clip);
- gdk_rectangle_union (&child_clip, &clip, &clip);
+ gtk_widget_size_allocate (child, &priv->child_allocation, -1, &child_clip);
+ gdk_rectangle_union (out_clip, &child_clip, out_clip);
}
-
- gtk_widget_set_clip (widget, &clip);
}
static void