[Slideshow] Applying Open source patch r72492 to fix Switching in slideshow with...
authorRajeev Ranjan <rajeev.r@samsung.com>
Mon, 16 Jul 2012 12:30:38 +0000 (18:00 +0530)
committerRajeev Ranjan <rajeev.r@samsung.com>
Mon, 16 Jul 2012 12:30:38 +0000 (18:00 +0530)
Change-Id: I3abf75efce1cf622e601c062a5b8b7db4fc26021

data/themes/widgets/slideshow.edc
src/bin/test_slideshow.c
src/lib/elm_slideshow.c

index e7b0898..defd5ca 100644 (file)
@@ -380,6 +380,22 @@ group { name: "elm/slideshow/base/default";
          target: "image_2_whole";
          after: "square_next_2";
       }
+      program { name: "next";
+         signal: "none,next";
+         source: "slideshow";
+         action: STATE_SET "fade_prev_next" 0.0;
+         target: "image_1_whole";
+         target: "image_2_whole";
+         after: "end";
+      }
+      program { name: "previous";
+         signal: "none,previous";
+         source: "slideshow";
+         action: STATE_SET "fade_prev_next" 0.0;
+         target: "image_1_whole";
+         target: "image_2_whole";
+         after: "end";
+      }
       program { name: "end";
          action: SIGNAL_EMIT "end" "slideshow";
       }
index 85ae340..d64eac5 100644 (file)
@@ -47,10 +47,10 @@ _mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev
 }
 
 static void
-_hv_select(void *data, Evas_Object *obj, void *event_info __UNUSED__)
+_hv_select(void *data, Evas_Object *obj, void *event_info)
 {
    elm_slideshow_transition_set(slideshow, data);
-   elm_object_text_set(obj, data);
+   elm_object_text_set(obj, elm_object_item_text_get(event_info));
 }
 
 static void
@@ -171,6 +171,7 @@ test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
    elm_hoversel_hover_parent_set(hv, win);
    EINA_LIST_FOREACH(elm_slideshow_transitions_get(slideshow), l, transition)
       elm_hoversel_item_add(hv, transition, NULL, 0, _hv_select, transition);
+   elm_hoversel_item_add(hv, "None", NULL, 0, _hv_select, NULL);
    elm_object_text_set(hv, eina_list_data_get(elm_slideshow_transitions_get(slideshow)));
    evas_object_show(hv);
 
index 08aa142..68549a4 100644 (file)
@@ -502,7 +502,11 @@ elm_slideshow_item_show(Elm_Object_Item *it)
      wd->timer = ecore_timer_add(wd->timeout, _timer_cb, WIDGET(item));
    _item_realize(next);
    edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(next));
-   snprintf(buf, sizeof(buf), "%s,next", wd->transition);
+
+   if (!wd->transition)
+     sprintf(buf, "none,next");
+   else
+     snprintf(buf, sizeof(buf), "%s,next", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");
    wd->previous = wd->current;
    wd->current = next;
@@ -535,7 +539,10 @@ elm_slideshow_next(Evas_Object *obj)
 
    edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(next));
 
-   snprintf(buf, sizeof(buf), "%s,next", wd->transition);
+   if (!wd->transition)
+     sprintf(buf, "none,next");
+   else
+     snprintf(buf, sizeof(buf), "%s,next", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");
 
    wd->previous = wd->current;
@@ -569,7 +576,10 @@ elm_slideshow_previous(Evas_Object *obj)
 
    edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(prev));
 
-   snprintf(buf, 1024, "%s,previous", wd->transition);
+   if (!wd->transition)
+     sprintf(buf, "none,previous");
+   else
+     snprintf(buf, sizeof(buf), "%s,previous", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");
 
    wd->previous = wd->current;