slider - don't send signals multiple times if the multiple key is pressed/up.

since slider popup has the interval for hide animation(may have, may have not)
just checking visible is not enough but this flag is correct.
This commit is contained in:
ChunEon Park 2014-04-18 12:00:32 +09:00
parent 7809e91bbc
commit bce93b6342
2 changed files with 13 additions and 8 deletions

View File

@ -301,6 +301,7 @@ _popup_show(void *data,
evas_object_layer_set(sd->popup, evas_object_layer_get(data));
evas_object_raise(sd->popup);
evas_object_show(sd->popup);
sd->popup_visible = EINA_TRUE;
edje_object_signal_emit(sd->popup, "popup,show", "elm"); // XXX: for compat
edje_object_signal_emit(sd->popup, "elm,popup,show", "elm");
}
@ -313,13 +314,14 @@ _popup_hide(void *data,
const char *source EINA_UNUSED)
{
ELM_SLIDER_DATA_GET(data, sd);
if (sd->popup)
if (!sd->popup_visible || !sd->popup) return;
if (!(elm_widget_focus_get(data) && sd->always_popup_show))
{
if (!(elm_widget_focus_get(data) && sd->always_popup_show))
{
edje_object_signal_emit(sd->popup, "popup,hide", "elm"); // XXX: for compat
edje_object_signal_emit(sd->popup, "elm,popup,hide", "elm");
}
// XXX: for compat
edje_object_signal_emit(sd->popup, "popup,hide", "elm");
edje_object_signal_emit(sd->popup, "elm,popup,hide", "elm");
}
}
@ -333,7 +335,10 @@ _popup_hide_done(void *data,
if (sd->popup)
{
if (!(elm_widget_focus_get(data) && sd->always_popup_show))
evas_object_hide(sd->popup);
{
evas_object_hide(sd->popup);
sd->popup_visible = EINA_FALSE;
}
}
}
@ -393,7 +398,6 @@ _elm_slider_elm_widget_event(Eo *obj, Elm_Slider_Data *sd, Evas_Object *src, Eva
}
else if (type == EVAS_CALLBACK_KEY_UP)
{
if (evas_object_visible_get(sd->popup))
_popup_hide(obj, NULL, NULL, NULL);
return EINA_FALSE;
}

View File

@ -45,6 +45,7 @@ struct _Elm_Slider_Data
/* this flag is to set the visiblity of slider indicator
if this flag is set then the indicator always show */
Eina_Bool always_popup_show : 1;
Eina_Bool popup_visible : 1;
};
/**