summaryrefslogtreecommitdiff
path: root/gtk/gtkrevealer.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/gtkrevealer.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/gtkrevealer.c')
-rw-r--r--gtk/gtkrevealer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index 1d2baf5c52..828453b855 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -94,8 +94,10 @@ static GParamSpec *props[LAST_PROP] = { NULL, };
static void gtk_revealer_real_add (GtkContainer *widget,
GtkWidget *child);
-static void gtk_revealer_real_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
+static void gtk_revealer_real_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip);
static void gtk_revealer_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
@@ -293,9 +295,9 @@ effective_transition (GtkRevealer *revealer)
}
static void
-gtk_revealer_get_child_allocation (GtkRevealer *revealer,
- GtkAllocation *allocation,
- GtkAllocation *child_allocation)
+gtk_revealer_get_child_allocation (GtkRevealer *revealer,
+ const GtkAllocation *allocation,
+ GtkAllocation *child_allocation)
{
GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
GtkWidget *child;
@@ -357,12 +359,13 @@ gtk_revealer_real_add (GtkContainer *container,
}
static void
-gtk_revealer_real_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
+gtk_revealer_real_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip)
{
GtkRevealer *revealer = GTK_REVEALER (widget);
GtkWidget *child;
- GtkAllocation clip = *allocation;
child = gtk_bin_get_child (GTK_BIN (revealer));
if (child != NULL && gtk_widget_get_visible (child))
@@ -370,11 +373,8 @@ gtk_revealer_real_size_allocate (GtkWidget *widget,
GtkAllocation child_allocation;
gtk_revealer_get_child_allocation (revealer, allocation, &child_allocation);
- gtk_widget_size_allocate (child, &child_allocation);
- gtk_widget_get_clip (child, &clip);
+ gtk_widget_size_allocate (child, &child_allocation, -1, out_clip);
}
-
- gtk_widget_set_clip (widget, &clip);
}
static void