Ephoto: Add more transitions for slideshow.

This commit is contained in:
Stephen okra Houston 2016-07-22 12:10:15 -05:00
parent b186c391da
commit 1084841bed
3 changed files with 76 additions and 12 deletions

View File

@ -405,7 +405,7 @@ collections {
} }
group { name: "ephoto,slideshow,base"; group { name: "ephoto,slideshow,base";
data { data {
item: transitions "fade black_fade horizontal vertical square"; item: transitions "fade black_fade square";
} }
parts { parts {
rect { "background"; rect { "background";
@ -422,6 +422,10 @@ collections {
rel2.to: "background"; rel2.to: "background";
color: 255 255 255 255; color: 255 255 255 255;
} }
description { state: "fade" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
}
description { state: "black_fade_init" 0.0; description { state: "black_fade_init" 0.0;
inherit: "default" 0.0; inherit: "default" 0.0;
color: 255 255 255 255; color: 255 255 255 255;
@ -430,6 +434,10 @@ collections {
inherit: "default" 0.0; inherit: "default" 0.0;
color: 0 0 0 255; color: 0 0 0 255;
} }
description { state: "square" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
}
} }
rect { "slide_clip2"; rect { "slide_clip2";
scale: 1; scale: 1;
@ -438,6 +446,10 @@ collections {
rel2.to: "background"; rel2.to: "background";
color: 255 255 255 0; color: 255 255 255 0;
} }
description { state: "fade" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
description { state: "black_fade_init" 0.0; description { state: "black_fade_init" 0.0;
inherit: "default" 0.0; inherit: "default" 0.0;
color: 0 0 0 255; color: 0 0 0 255;
@ -446,15 +458,17 @@ collections {
inherit: "default" 0.0; inherit: "default" 0.0;
color: 255 255 255 255; color: 255 255 255 255;
} }
} description { state: "square_init" 0.0;
swallow { "ephoto.swallow.slideshow.item2"; inherit: "default" 0.0;
scale: 1; rel1.relative: 0.5 0.5;
mouse_events: 1; rel2.relative: 0.5 0.5;
clip_to: "slide_clip2"; color: 255 255 255 255;
description { }
state: "default" 0.0; description { state: "square" 0.0;
rel1.to: "slide_clip2"; inherit: "default" 0.0;
rel2.to: "slide_clip2"; rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
color: 255 255 255 255;
} }
} }
swallow { "ephoto.swallow.slideshow.item"; swallow { "ephoto.swallow.slideshow.item";
@ -467,8 +481,33 @@ collections {
rel2.to: "slide_clip"; rel2.to: "slide_clip";
} }
} }
swallow { "ephoto.swallow.slideshow.item2";
scale: 1;
mouse_events: 1;
clip_to: "slide_clip2";
description {
state: "default" 0.0;
rel1.to: "slide_clip2";
rel2.to: "slide_clip2";
}
}
} }
programs { programs {
program {
signal: "ephoto,fade";
source: "ephoto";
action: STATE_SET "default" 0.0;
target: "slide_clip";
target: "slide_clip2";
after: "fade_2";
}
program { name: "fade_2";
action: STATE_SET "fade" 0.0;
target: "slide_clip";
target: "slide_clip2";
transition: SINUSOIDAL 1.5;
after: "end";
}
program { program {
signal: "ephoto,black_fade"; signal: "ephoto,black_fade";
source: "ephoto"; source: "ephoto";
@ -493,6 +532,28 @@ collections {
transition: SINUSOIDAL 0.75; transition: SINUSOIDAL 0.75;
after: "end"; after: "end";
} }
program {
signal: "ephoto,square";
source: "ephoto";
action: STATE_SET "square_init" 0.0;
target: "slide_clip2";
after: "square_next_2";
}
program { name: "square_next_2";
action: STATE_SET "square" 0.0;
target: "slide_clip";
target: "slide_clip2";
transition: SINUSOIDAL 1.5;
after: "end";
}
program {
signal: "ephoto,none";
source: "ephoto";
action: STATE_SET "fade" 0.0;
target: "slide_clip";
target: "slide_clip2";
after: "end";
}
program { name: "end"; program { name: "end";
action: SIGNAL_EMIT "ephoto,transition,end" "ephoto"; action: SIGNAL_EMIT "ephoto,transition,end" "ephoto";
} }

View File

@ -233,7 +233,7 @@ _config_slideshow(Ephoto *ephoto, Evas_Object *parent)
EINA_LIST_FOREACH(transitions, l, EINA_LIST_FOREACH(transitions, l,
transition) elm_hoversel_item_add(hoversel, transition, NULL, 0, transition) elm_hoversel_item_add(hoversel, transition, NULL, 0,
_hv_select, transition); _hv_select, transition);
elm_hoversel_item_add(hoversel, "None", NULL, 0, _hv_select, NULL); elm_hoversel_item_add(hoversel, "none", NULL, 0, _hv_select, NULL);
elm_object_text_set(hoversel, ephoto->config->slideshow_transition); elm_object_text_set(hoversel, ephoto->config->slideshow_transition);
evas_object_size_hint_weight_set(hoversel, EVAS_HINT_EXPAND, evas_object_size_hint_weight_set(hoversel, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND); EVAS_HINT_EXPAND);

View File

@ -217,6 +217,7 @@ static Eina_Bool
_slideshow_transition(void *data) _slideshow_transition(void *data)
{ {
Ephoto_Slideshow *ss = data; Ephoto_Slideshow *ss = data;
char buf[PATH_MAX];
if (ss->playing == 0) if (ss->playing == 0)
{ {
@ -241,7 +242,8 @@ _slideshow_transition(void *data)
ss->current_item); ss->current_item);
evas_object_show(ss->current_item); evas_object_show(ss->current_item);
elm_layout_signal_emit(ss->slideshow, "ephoto,black_fade", "ephoto"); snprintf(buf, PATH_MAX, "ephoto,%s", ss->ephoto->config->slideshow_transition);
elm_layout_signal_emit(ss->slideshow, buf, "ephoto");
if (ss->ephoto->config->movess) if (ss->ephoto->config->movess)
{ {
elm_layout_signal_emit(ss->current_item, _slideshow_move_start_get(ss), "ephoto"); elm_layout_signal_emit(ss->current_item, _slideshow_move_start_get(ss), "ephoto");
@ -268,6 +270,7 @@ _slideshow_play(Ephoto_Slideshow *ss)
ss->slideshow); ss->slideshow);
elm_layout_content_set(ss->slideshow, "ephoto.swallow.slideshow.item", elm_layout_content_set(ss->slideshow, "ephoto.swallow.slideshow.item",
ss->current_item); ss->current_item);
evas_object_raise(ss->current_item);
evas_object_show(ss->current_item); evas_object_show(ss->current_item);
} }
_slideshow_move_randomize(ss); _slideshow_move_randomize(ss);