[gnome-control-center/wip/animated-notebook] shell: You can't remove the current page



commit a878f5db04c5d1bed842ba6640f3e17b3cde038a
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 4 12:36:02 2012 +0100

    shell: You can't remove the current page
    
    That avoids a host of problems.

 shell/TODO          |    1 -
 shell/cc-notebook.c |    6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/shell/TODO b/shell/TODO
index d5e07f8..731a33b 100644
--- a/shell/TODO
+++ b/shell/TODO
@@ -1,5 +1,4 @@
 - Remove index from the public API
-- Fix cc_notebook_remove_page() when current page is removed
 - Make transitions between pages always be contiguous
 - Add a scroll direction to the animation
   (back to parent to the left, to a child to the right)
diff --git a/shell/cc-notebook.c b/shell/cc-notebook.c
index 15198f3..ab2ae84 100644
--- a/shell/cc-notebook.c
+++ b/shell/cc-notebook.c
@@ -383,13 +383,14 @@ cc_notebook_add_page (CcNotebook *self,
 
 void
 cc_notebook_remove_page (CcNotebook *self,
-                           GtkWidget    *widget)
+                         GtkWidget  *widget)
 {
         ClutterActorIter iter;
         ClutterActor *child;
 
         g_return_if_fail (CC_IS_NOTEBOOK (self));
         g_return_if_fail (GTK_IS_WIDGET (widget));
+        g_return_if_fail (widget != self->priv->selected_page);
 
         clutter_actor_iter_init (&iter, self->priv->bin);
         while (clutter_actor_iter_next (&iter, &child)) {
@@ -397,11 +398,10 @@ cc_notebook_remove_page (CcNotebook *self,
 
                 if (gtk_clutter_actor_get_contents (GTK_CLUTTER_ACTOR (embed)) == widget) {
                         clutter_actor_iter_remove (&iter);
+                        /* FIXME reset scroll to current page */
                         return;
                 }
         }
-
-        /* FIXME current page getting removed :((( */
 }
 
 int



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