[glide] Fix some bugs with slide hiding when changing slides that were introduced when fade effects were add



commit a805a5aa9028239cf352178610e8191d437eb344
Author: Robert Carr <racarr Valentine localdomain>
Date:   Fri May 7 11:38:11 2010 -0400

    Fix some bugs with slide hiding when changing slides that were introduced when fade effects were added to the stage manager

 libglide/glide-stage-manager.c |   36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/libglide/glide-stage-manager.c b/libglide/glide-stage-manager.c
index 8bbe28b..b5ca4a4 100644
--- a/libglide/glide-stage-manager.c
+++ b/libglide/glide-stage-manager.c
@@ -200,26 +200,36 @@ glide_stage_manager_add_manipulator (GlideStageManager *manager)
   manager->priv->manip = manip;
 }
 
-void
-glide_stage_manager_set_slide (GlideStageManager *manager, guint slide)
+void 
+glide_stage_manager_set_slide (GlideStageManager *manager,
+			       guint slide)
 {
-  GlideSlide *s = glide_document_get_nth_slide (manager->priv->document, slide);
-  if (manager->priv->current_slide >= 0 && !(manager->priv->current_slide >= glide_document_get_n_slides(manager->priv->document)))
+  GlideSlide *a, *b = glide_document_get_nth_slide (manager->priv->document, slide);
+  if (manager->priv->current_slide >= 0 && !(manager->priv->current_slide >= glide_document_get_n_slides (manager->priv->document)))
+    a = glide_document_get_nth_slide (manager->priv->document,
+				      manager->priv->current_slide);
+  else
+    a = NULL;
+  
+  if (!a)
+    clutter_actor_show_all (CLUTTER_ACTOR (b));
+  else if (manager->priv->presenting)
     {
-      glide_stage_manager_effect_fade (CLUTTER_ACTOR (glide_document_get_nth_slide (manager->priv->document, 
-										    manager->priv->current_slide)),
-				       CLUTTER_ACTOR (s));
+      clutter_actor_hide_all (CLUTTER_ACTOR (a));
+      clutter_actor_show_all (CLUTTER_ACTOR (b));
     }
   else
-    clutter_actor_show_all (CLUTTER_ACTOR (s));
+    {
+      glide_stage_manager_effect_fade (CLUTTER_ACTOR (a), CLUTTER_ACTOR (b));
+    }
+  
   manager->priv->current_slide = slide;
-
   
   glide_stage_manager_add_manipulator (manager);
-  glide_stage_manager_set_selection (manager, GLIDE_ACTOR (s));
-  
-  GLIDE_NOTE(STAGE_MANAGER, "Switching to slide index: %u", glide_slide_get_index (s));
-  
+  glide_stage_manager_set_selection (manager, GLIDE_ACTOR (b));
+    
+  GLIDE_NOTE (STAGE_MANAGER, "Switching to slide index: %u", glide_slide_get_index (b));
+
   g_object_notify (G_OBJECT (manager), "current-slide");
 }
 



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