* @section Gengrid_Smart_Events Gengrid smart events
*
* Smart events that you can add callbacks for are:
- * - @c "clicked,double" - The user has double-clicked or pressed
- * enter on an item. The @c event_info parameter is the gengrid
- * item that was double-clicked.
+ * - @c "activated" - The user has double-clicked or pressed
+ * (enter|return|spacebar) on an item. The @c event_info parameter
+ * is the gengrid item that was activated.
+ * - @c "clicked,double" - The user has double-clicked an item.
+ * The @c event_info parameter is the gengrid item that was double-clicked.
* - @c "selected" - The user has made an item selected. The
* @c event_info parameter is the gengrid item that was selected.
* - @c "unselected" - The user has made an item unselected. The
* lists, @ref Genlist should probably be used.
*
* Smart callbacks one can listen to:
- * - "clicked,double" - when the user double-clicked an item
+ * - @c "activated" - The user has double-clicked or pressed
+ * (enter|return|spacebar) on an item. The @c event_info parameter
+ * is the item that was activated.
+ * - @c "clicked,double" - The user has double-clicked an item.
+ * The @c event_info parameter is the item that was double-clicked.
* - "selected" - when the user selected an item
* - "unselected" - when the user unselected an item
* - "longpressed" - an item in the list is long-pressed
EAPI void elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode) EINA_ARG_NONNULL(1);
EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/* Signals that you can add callbacks for are:
- * "clicked,double" - This is called when a user has double-clicked an item.
- * The event_info parameter is the genlist item that was
- * double-clicked.
+ * - @c "activated" - The user has double-clicked or pressed
+ * (enter|return|spacebar) on an item. The @c event_info parameter
+ * is the item that was activated.
+ * - @c "clicked,double" - The user has double-clicked an item.
+ * The @c event_info parameter is the item that was double-clicked.
* "selected" - This is called when a user has made an item selected. The
* event_info parameter is the genlist item that was selected.
* "unselected" - This is called when a user has made an item unselected. The
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
+static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
static const char SIG_SELECTED[] = "selected";
static const char SIG_UNSELECTED[] = "unselected";
static const char SIG_MOVED[] = "moved";
static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_ACTIVATED, ""},
{SIG_CLICKED_DOUBLE, ""},
{SIG_SELECTED, ""},
{SIG_UNSELECTED, ""},
(!strcmp(ev->keyname, "space")))
{
item = elm_gengrid_selected_item_get(obj);
- evas_object_smart_callback_call(item->wd->self, SIG_CLICKED_DOUBLE, item);
+ evas_object_smart_callback_call(item->wd->self, SIG_ACTIVATED, item);
}
else return EINA_FALSE;
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
{
evas_object_smart_callback_call(item->wd->self, SIG_CLICKED_DOUBLE, item);
- evas_object_smart_callback_call(item->wd->self, "clicked", item); // will be removed
+ evas_object_smart_callback_call(item->wd->self, SIG_ACTIVATED, item);
}
if (item->long_timer) ecore_timer_del(item->long_timer);
if (item->realized)
static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_VERSION;
+static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
static const char SIG_SELECTED[] = "selected";
static const char SIG_UNSELECTED[] = "unselected";
static const Evas_Smart_Cb_Description _signals[] = {
{SIG_CLICKED_DOUBLE, ""},
+ {SIG_ACTIVATED, ""},
{SIG_SELECTED, ""},
{SIG_UNSELECTED, ""},
{SIG_EXPANDED, ""},
it = elm_genlist_selected_item_get(obj);
elm_genlist_item_expanded_set(it,
!elm_genlist_item_expanded_get(it));
+ evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
}
else if (!strcmp(ev->keyname, "Escape"))
{
_item_highlight(it);
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
if ((!it->disabled) && (!it->display_only))
- evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
+ {
+ evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
+ evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
+ }
if (it->long_timer) ecore_timer_del(it->long_timer);
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it);
Evas_Callback_Type type, void *event_info);
static Eina_Bool _deselect_all_items(Widget_Data *wd);
+static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
static const char SIG_SELECTED[] = "selected";
static const char SIG_UNSELECTED[] = "unselected";
static const char SIG_SCROLL_EDGE_RIGHT[] = "scroll,edge,right";
static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_ACTIVATED, ""},
{SIG_CLICKED_DOUBLE, ""},
{SIG_SELECTED, ""},
{SIG_UNSELECTED, ""},
y += page_y;
}
}
+ else if (((!strcmp(ev->keyname, "Return")) ||
+ (!strcmp(ev->keyname, "KP_Enter")) ||
+ (!strcmp(ev->keyname, "space")))
+ && (!wd->multi) && (wd->selected))
+ {
+ it = elm_list_selected_item_get(obj);
+ evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
+ }
else if (!strcmp(ev->keyname, "Escape"))
{
if (!_deselect_all_items(wd)) return EINA_FALSE;
it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it);
/* Always call the callbacks last - the user may delete our context! */
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
- evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
+ {
+ evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
+ evas_object_smart_callback_call(it->base.widget, SIG_ACTIVATED, it);
+ }
wd->swipe = EINA_FALSE;
wd->movements = 0;