summaryrefslogtreecommitdiff
path: root/gtk/gtkoverlay.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/gtkoverlay.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/gtkoverlay.c')
-rw-r--r--gtk/gtkoverlay.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index baea9d3502..71dfd2d8bd 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -238,6 +238,7 @@ gtk_overlay_child_allocate (GtkOverlay *overlay,
GtkOverlayChild *child)
{
GtkAllocation child_allocation;
+ GtkAllocation child_clip;
if (!gtk_widget_get_visible (child->widget))
return;
@@ -245,23 +246,25 @@ gtk_overlay_child_allocate (GtkOverlay *overlay,
gtk_overlay_compute_child_allocation (overlay, child, &child_allocation);
gtk_overlay_child_update_style_classes (overlay, child->widget, &child_allocation);
- gtk_widget_size_allocate (child->widget, &child_allocation);
+ gtk_widget_size_allocate (child->widget, &child_allocation, -1, &child_clip);
}
static void
-gtk_overlay_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
+gtk_overlay_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip)
{
GtkOverlay *overlay = GTK_OVERLAY (widget);
GtkOverlayPrivate *priv = overlay->priv;
GSList *children;
GtkWidget *main_widget;
- GTK_WIDGET_CLASS (gtk_overlay_parent_class)->size_allocate (widget, allocation);
+ GTK_WIDGET_CLASS (gtk_overlay_parent_class)->size_allocate (widget, allocation, baseline, out_clip);
main_widget = gtk_bin_get_child (GTK_BIN (overlay));
if (main_widget && gtk_widget_get_visible (main_widget))
- gtk_widget_size_allocate (main_widget, allocation);
+ gtk_widget_size_allocate (main_widget, allocation, -1, out_clip);
for (children = priv->children; children; children = children->next)
gtk_overlay_child_allocate (overlay, children->data);