diff options
author | Timm Bäder <mail@baedert.org> | 2017-07-11 09:58:21 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:16 -0400 |
commit | 36ab70ddf5dbe993eb995bd9157f347258765922 (patch) | |
tree | 508f0ca9cf6b4fc990e88b0a5892b50f594890fe /gtk/gtkpopover.c | |
parent | 95bd58ac00ede771ca80684e143fffdc61ff2194 (diff) | |
download | gtk+-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/gtkpopover.c')
-rw-r--r-- | gtk/gtkpopover.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index b1ca46afe2..06b2a2e8ef 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -252,7 +252,7 @@ allocate_contents (GtkGizmo *gizmo, GtkWidget *child = gtk_bin_get_child (GTK_BIN (popover)); if (child) - gtk_widget_size_allocate (child, (GtkAllocation*)allocation); + gtk_widget_size_allocate (child, allocation, -1, out_clip); } static void @@ -368,6 +368,7 @@ gtk_popover_get_property (GObject *object, static gboolean transitions_enabled (GtkPopover *popover) { + /*return FALSE;*/ return gtk_settings_get_enable_animations (gtk_widget_get_settings (GTK_WIDGET (popover))); } @@ -1366,13 +1367,13 @@ gtk_popover_measure (GtkWidget *widget, } static void -gtk_popover_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) +gtk_popover_size_allocate (GtkWidget *widget, + const GtkAllocation *allocation, + int baseline, + GtkAllocation *out_clip) { GtkPopover *popover = GTK_POPOVER (widget); GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover); - GtkAllocation child_clip; - GtkAllocation clip = *allocation; GtkAllocation child_alloc = *allocation; /* Note that we in measure() we add TAIL_HEIGHT in both directions, regardless @@ -1401,9 +1402,7 @@ gtk_popover_size_allocate (GtkWidget *widget, break; } - gtk_widget_size_allocate (priv->contents_widget, &child_alloc); - gtk_widget_get_clip (priv->contents_widget, &child_clip); - gdk_rectangle_union (&clip, &child_clip, &clip); + gtk_widget_size_allocate (priv->contents_widget, &child_alloc, -1, out_clip); if (gtk_widget_get_realized (widget)) { @@ -1413,8 +1412,6 @@ gtk_popover_size_allocate (GtkWidget *widget, a.x, a.y, a.width, a.height); gtk_popover_update_shape (popover); } - - gtk_widget_set_clip (widget, &clip); } static gboolean @@ -1835,9 +1832,11 @@ _gtk_popover_parent_unmap (GtkWidget *widget, } static void -_gtk_popover_parent_size_allocate (GtkWidget *widget, - GtkAllocation *allocation, - GtkPopover *popover) +_gtk_popover_parent_size_allocate (GtkWidget *widget, + const GtkAllocation *allocation, + int baseline, + GtkAllocation *out_clip, + GtkPopover *popover) { gtk_popover_update_position (popover); } |