From b5ee0e3e829b826ba283538a034ef27e0300a123 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 5 Oct 2010 14:12:45 +0200 Subject: e-map: Use gtk_alignment_configure() Nothing but a massive code cleanup --- widgets/misc/e-map.c | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'widgets/misc') diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index 0611ff20bc..56c966bf84 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -1445,30 +1445,22 @@ set_scroll_area (EMap *view, int width, int height) gtk_widget_get_allocation (GTK_WIDGET (view), &allocation); - /* Set scroll increments */ - - gtk_adjustment_set_page_size (priv->hadj, allocation.width); - gtk_adjustment_set_page_increment (priv->hadj, allocation.width / 2); - gtk_adjustment_set_step_increment (priv->hadj, SCROLL_STEP_SIZE); - - gtk_adjustment_set_page_size (priv->vadj, allocation.height); - gtk_adjustment_set_page_increment (priv->vadj, allocation.height / 2); - gtk_adjustment_set_step_increment (priv->vadj, SCROLL_STEP_SIZE); - - /* Set scroll bounds and new offsets */ - - gtk_adjustment_set_lower (priv->hadj, 0); - gtk_adjustment_set_upper (priv->hadj, width); + priv->xofs = CLAMP (priv->xofs, 0, width - allocation.width); + priv->yofs = CLAMP (priv->yofs, 0, height - allocation.height); - gtk_adjustment_set_lower (priv->vadj, 0); - gtk_adjustment_set_upper (priv->vadj, height); + gtk_adjustment_configure (priv->hadj, + priv->xofs, + 0, width, + SCROLL_STEP_SIZE, + allocation.width / 2, + allocation.width); + gtk_adjustment_configure (priv->vadj, + priv->yofs, + 0, height, + SCROLL_STEP_SIZE, + allocation.height / 2, + allocation.height); g_object_thaw_notify (G_OBJECT (priv->hadj)); g_object_thaw_notify (G_OBJECT (priv->vadj)); - - priv->xofs = CLAMP (priv->xofs, 0, width - allocation.width); - priv->yofs = CLAMP (priv->yofs, 0, height - allocation.height); - - gtk_adjustment_set_value (priv->hadj, priv->xofs); - gtk_adjustment_set_value (priv->vadj, priv->yofs); } -- cgit v1.2.3