first attempt to stop fade (not working yet)
This commit is contained in:
parent
35c61b4b0e
commit
bc4f3b9240
|
@ -394,12 +394,25 @@ collections
|
|||
mouse_events: 1;
|
||||
repeat_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 0;
|
||||
rel.to: "entice.next";
|
||||
rel1.offset: -2 -2;
|
||||
rel2.offset: 2 2;
|
||||
visible: 0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
program
|
||||
{
|
||||
signal: "mouse,in";
|
||||
source: "fadenext";
|
||||
action: SIGNAL_EMIT "image,stopfade,next" "entice";
|
||||
}
|
||||
program
|
||||
{
|
||||
signal: "mouse,out";
|
||||
source: "fadenext";
|
||||
action: SIGNAL_EMIT "image,startfade,next" "entice";
|
||||
}
|
||||
|
||||
// Settings icon
|
||||
part
|
||||
|
|
|
@ -259,6 +259,49 @@ _cb_image_settings(void *win, Evas_Object *obj EINA_UNUSED, const char *emission
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_image_stopfade(void *win, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
printf("mouse in\n");
|
||||
fflush(stdout);
|
||||
|
||||
if (entice->controls_timer)
|
||||
{
|
||||
ecore_timer_del(entice->controls_timer);
|
||||
entice->controls_timer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_image_startfade(void *win, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
entice_controls_timer_start(win);
|
||||
printf("mouse out\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_controls_hide(void *win)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
entice->controls_timer = NULL;
|
||||
|
||||
/* hide controls */
|
||||
if (entice->controls_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,controls,hide", "entice");
|
||||
entice->controls_shown = EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
/*============================================================================*
|
||||
* Global *
|
||||
*============================================================================*/
|
||||
|
@ -280,6 +323,14 @@ entice_controls_init(Evas_Object *win)
|
|||
CONTROLS("go-previous", prev);
|
||||
CONTROLS("go-next", next);
|
||||
|
||||
elm_layout_signal_callback_add(entice->layout,
|
||||
"image,stopfade,next", "entice",
|
||||
_cb_image_stopfade, win);
|
||||
|
||||
elm_layout_signal_callback_add(entice->layout,
|
||||
"image,startfade,next", "entice",
|
||||
_cb_image_startfade, win);
|
||||
|
||||
/* best fit checkbox */
|
||||
o = elm_check_add(win);
|
||||
elm_object_style_set(o, "default");
|
||||
|
@ -322,3 +373,32 @@ entice_controls_update(Evas_Object *win)
|
|||
snprintf(buf, sizeof(buf), "%d%%", entice_image_zoom_get(entice->image));
|
||||
elm_object_text_set(entice->zoomval, buf);
|
||||
}
|
||||
|
||||
void
|
||||
entice_controls_timer_start(Evas_Object *win)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
if (entice->controls_timer)
|
||||
ecore_timer_del(entice->controls_timer);
|
||||
|
||||
entice->controls_timer = ecore_timer_add(entice->config->duration_controls,
|
||||
_cb_controls_hide, win);
|
||||
|
||||
/* display controls */
|
||||
if (eina_list_prev(entice->image_current))
|
||||
elm_object_signal_emit(entice->layout, "state,prev,show", "entice");
|
||||
else
|
||||
elm_object_signal_emit(entice->layout, "state,prev,hide", "entice");
|
||||
if (eina_list_next(entice->image_current))
|
||||
elm_object_signal_emit(entice->layout, "state,next,show", "entice");
|
||||
else
|
||||
elm_object_signal_emit(entice->layout, "state,next,hide", "entice");
|
||||
if (!entice->controls_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,controls,show", "entice");
|
||||
entice->controls_shown = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,4 +31,6 @@ void entice_controls_init(Evas_Object *win);
|
|||
|
||||
void entice_controls_update(Evas_Object *win);
|
||||
|
||||
void entice_controls_timer_start(Evas_Object *win);
|
||||
|
||||
#endif /* ENTICE_CONTROLS_H */
|
||||
|
|
|
@ -140,52 +140,10 @@ _cb_unfocused(void *data EINA_UNUSED, Evas_Object *win, void *event EINA_UNUSED)
|
|||
elm_layout_signal_emit(entice->layout, "state,win,unfocused", "entice");
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_mouse_idle(void *win)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
entice->controls_timer = NULL;
|
||||
|
||||
/* hide controls */
|
||||
if (entice->controls_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,controls,hide", "entice");
|
||||
entice->controls_shown = EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_mouse_move(void *win, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
if (entice->controls_timer)
|
||||
ecore_timer_del(entice->controls_timer);
|
||||
|
||||
entice->controls_timer = ecore_timer_add(entice->config->duration_controls,
|
||||
_cb_mouse_idle, win);
|
||||
|
||||
/* display controls */
|
||||
if (eina_list_prev(entice->image_current))
|
||||
elm_object_signal_emit(entice->layout, "state,prev,show", "entice");
|
||||
else
|
||||
elm_object_signal_emit(entice->layout, "state,prev,hide", "entice");
|
||||
if (eina_list_next(entice->image_current))
|
||||
elm_object_signal_emit(entice->layout, "state,next,show", "entice");
|
||||
else
|
||||
elm_object_signal_emit(entice->layout, "state,next,hide", "entice");
|
||||
if (!entice->controls_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,controls,show", "entice");
|
||||
entice->controls_shown = EINA_TRUE;
|
||||
}
|
||||
entice_controls_timer_start(win);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue