[gnome-control-center/wip/animated-notebook] shell: Reset the viewport when the width changes



commit 7d43efd439992e84f587ed14cf201e0341ee4e88
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 2 17:57:18 2012 +0100

    shell: Reset the viewport when the width changes

 shell/cc-notebook.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/shell/cc-notebook.c b/shell/cc-notebook.c
index 002ee3f..4f7599b 100644
--- a/shell/cc-notebook.c
+++ b/shell/cc-notebook.c
@@ -113,6 +113,7 @@ on_embed_size_allocate (GtkWidget     *embed,
         ClutterActor *child;
         float page_w, page_h;
         float offset = 0.f;
+        ClutterPoint pos;
 
         /* we only care about the width changes, since we need to recompute the
          * offset of the pages
@@ -132,6 +133,9 @@ on_embed_size_allocate (GtkWidget     *embed,
         }
 
         self->priv->last_width = allocation->width;
+        pos.y = 0;
+        pos.x = self->priv->last_width * self->priv->selected_index;
+        clutter_scroll_actor_scroll_to_point (CLUTTER_SCROLL_ACTOR (self->priv->scroll), &pos);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]