[gnome-system-tools/rendering-cleanup: 12/20] e-map: Use gtk_alignment_configure()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-tools/rendering-cleanup: 12/20] e-map: Use gtk_alignment_configure()
- Date: Tue, 5 Oct 2010 16:41:12 +0000 (UTC)
commit 36826211f7ed3acbe6ad273ead909eba03c6538b
Author: Benjamin Otte <otte redhat com>
Date: Tue Oct 5 14:12:45 2010 +0200
e-map: Use gtk_alignment_configure()
Nothing but a massive code cleanup
src/time/e-map/e-map.c | 36 ++++++++++++++----------------------
1 files changed, 14 insertions(+), 22 deletions(-)
---
diff --git a/src/time/e-map/e-map.c b/src/time/e-map/e-map.c
index e007b38..d379d73 100644
--- a/src/time/e-map/e-map.c
+++ b/src/time/e-map/e-map.c
@@ -1500,30 +1500,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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]