diff options
author | Timm Bäder <mail@baedert.org> | 2017-06-18 15:45:42 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:14 -0400 |
commit | c2abb698bea9e9f16f3187e5dbb0f32ec555d694 (patch) | |
tree | 499d6f3d36102b4af5b432c2e7d45b70de5ce931 /gtk/gtkstack.c | |
parent | e36ddfec177773ba993a8f8dcd566cf3fb3bb5aa (diff) | |
download | gtk+-c2abb698bea9e9f16f3187e5dbb0f32ec555d694.tar.gz |
Replace a few get_content_allocation calls with get_content_size
The position of the content allocation is almost never relevant since
it's 0/0 for measure, size_allocate and snapshot.
Diffstat (limited to 'gtk/gtkstack.c')
-rw-r--r-- | gtk/gtkstack.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index cb2276c13a..7114b54199 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -719,17 +719,17 @@ static gint get_bin_window_x (GtkStack *stack) { GtkStackPrivate *priv = gtk_stack_get_instance_private (stack); - GtkAllocation allocation; + int width, height; int x = 0; - gtk_widget_get_content_allocation (GTK_WIDGET (stack), &allocation); + gtk_widget_get_content_size (GTK_WIDGET (stack), &width, &height); if (gtk_progress_tracker_get_state (&priv->tracker) != GTK_PROGRESS_STATE_AFTER) { if (is_left_transition (priv->active_transition_type)) - x = allocation.width * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); + x = width * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); if (is_right_transition (priv->active_transition_type)) - x = -allocation.width * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); + x = -width * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); } return x; @@ -739,17 +739,17 @@ static gint get_bin_window_y (GtkStack *stack) { GtkStackPrivate *priv = gtk_stack_get_instance_private (stack); - GtkAllocation allocation; + int width, height; int y = 0; - gtk_widget_get_content_allocation (GTK_WIDGET (stack), &allocation); + gtk_widget_get_content_size (GTK_WIDGET (stack), &width, &height); if (gtk_progress_tracker_get_state (&priv->tracker) != GTK_PROGRESS_STATE_AFTER) { if (is_up_transition (priv->active_transition_type)) - y = allocation.height * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); + y = height * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); if (is_down_transition(priv->active_transition_type)) - y = -allocation.height * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); + y = -height * (1 - gtk_progress_tracker_get_ease_out_cubic (&priv->tracker, FALSE)); } return y; |