Hi,
  This is a patch to configure if the first animation of an elm_pager will
be shown or not. There are some applications in which this first animation
seems weird.

thanks

-- 
--
Alex Bredariol Grilo
ProFUSION embedded systems
http://profusion.mobi
Index: src/lib/elm_pager.c
===================================================================
--- src/lib/elm_pager.c	(revision 53651)
+++ src/lib/elm_pager.c	(working copy)
@@ -28,6 +28,8 @@
    Eina_List *stack;
    Item *top, *oldtop;
    Evas_Object *rect, *clip;
+   Eina_Bool show_first_animation;
+   Eina_Bool first_animation;
 };
 
 struct _Item
@@ -141,7 +143,9 @@
 	wd->top = ittop;
 	o = wd->top->base;
 	evas_object_show(o);
-	if (wd->oldtop && wd->oldtop->popme)
+ 	if ((!wd->show_first_animation) && (wd->first_animation))
+	    edje_object_signal_emit(o, "elm,action,show,no-animation", "elm");
+ 	else if (wd->oldtop && wd->oldtop->popme)
 	    edje_object_signal_emit(o, "elm,action,show", "elm");
 	else
 	    edje_object_signal_emit(o, "elm,action,push", "elm");
@@ -152,6 +156,7 @@
 	     else if (!strcmp(onshow, "lower")) evas_object_lower(o);
 	  }
      }
+   wd->first_animation = EINA_FALSE;
 }
 
 static void
@@ -246,6 +251,9 @@
    elm_widget_resize_object_set(obj, wd->clip);
    elm_widget_sub_object_add(obj, wd->clip);
 
+   wd->first_animation = EINA_TRUE;
+   wd->show_first_animation = EINA_TRUE;
+
    wd->rect = evas_object_rectangle_add(e);
    elm_widget_sub_object_add(obj, wd->rect);
    evas_object_color_set(wd->rect, 255, 255, 255, 0); 
@@ -425,3 +433,39 @@
    return wd->top->content;
 }
 
+/**
+ * Return if the first animation will be shown
+ *
+ * @param obj The pager object
+ * @return If the first animation will be shown
+ *
+ * @ingroup Pager
+ */
+EAPI Eina_Bool
+elm_pager_show_first_animation_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   return wd->show_first_animation;
+}
+
+/**
+ * Set if the first animation will be shown
+ *
+ * By default the first animation will be shown
+ * By calling this and providing @p setting as false, the first animation will
+ * not be shown
+ * horizontal arranging contents left to right.
+ *
+ * @param obj The pager object
+ * @param setting If the first animation will be shown
+ *
+ * @ingroup Pager
+ */
+EAPI void
+elm_pager_show_first_animation_set(const Evas_Object *obj, Eina_Bool setting)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   wd->show_first_animation = setting;
+}
Index: src/lib/Elementary.h.in
===================================================================
--- src/lib/Elementary.h.in	(revision 53651)
+++ src/lib/Elementary.h.in	(working copy)
@@ -1525,6 +1525,8 @@
    EAPI void         elm_pager_content_promote(Evas_Object *obj, Evas_Object *content);
    EAPI Evas_Object *elm_pager_content_bottom_get(const Evas_Object *obj);
    EAPI Evas_Object *elm_pager_content_top_get(const Evas_Object *obj);
+   EAPI Eina_Bool    elm_pager_show_first_animation_get(const Evas_Object *obj);
+   EAPI void         elm_pager_show_first_animation_set(const Evas_Object *obj, Eina_Bool setting);
    /* available item styles:
     * default
     * fade
Index: data/themes/default.edc
===================================================================
--- data/themes/default.edc	(revision 53651)
+++ data/themes/default.edc	(working copy)
@@ -22607,6 +22607,13 @@
 	    target: "clip";
             after: "show_end";
 	 }
+     program { name: "show_start_no_animation";
+        signal: "elm,action,show,no-animation";
+	    action:  STATE_SET "visible" 0.0;
+	    target: "base";
+	    target: "clip";
+        after: "show_end";
+	 }
          program { name: "show_end";
             action: SIGNAL_EMIT "elm,action,show,finished" "";
 	 }
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to