summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.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/gtkspinbutton.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/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index d1eaef20c7..2593cd8bd1 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -253,8 +253,10 @@ static void gtk_spin_button_measure (GtkWidget *widget,
int *natural,
int *minimum_baseline,
int *natural_baseline);
-static void gtk_spin_button_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
+static void gtk_spin_button_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip);
static gint gtk_spin_button_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_spin_button_grab_notify (GtkWidget *widget,
@@ -1055,17 +1057,14 @@ gtk_spin_button_measure (GtkWidget *widget,
}
static void
-gtk_spin_button_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
+gtk_spin_button_size_allocate (GtkWidget *widget,
+ const GtkAllocation *allocation,
+ int baseline,
+ GtkAllocation *out_clip)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (GTK_SPIN_BUTTON (widget));
- GtkAllocation clip = *allocation;
- gtk_widget_size_allocate_with_baseline (priv->box, allocation,
- gtk_widget_get_allocated_baseline (widget));
- gtk_widget_get_clip (priv->box, &clip);
-
- gtk_widget_set_clip (widget, &clip);
+ gtk_widget_size_allocate (priv->box, allocation, baseline, out_clip);
}
static gint