diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 0060f0ae2a..66e4536437 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1735,3 +1735,9 @@ 2013-10-30 Shilpa Onkar Singh * slider: Added elm_slider_step_get(), elm_slider_step_set(). + +2013-10-02 Ryuan Choi (ryuan) + + * genlist , gengrid: Add ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL. + It disallow multiple selection when clicked without control pressed although + multiple selection is enabled. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 93428514b2..4ba58bf282 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -101,6 +101,7 @@ Additions: * Add support for "clicked" callback on Return/space/KP_Enter key press for image. * Add "virtualkeypad,size,changed" callback on virtualkeypad min size change for conformant. * Add elm_slider_step_get(), elm_slider_step_set() for slider. + * Add ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL select mode for genlist/gengrid. Improvements: diff --git a/legacy/elementary/src/lib/elm_general.h b/legacy/elementary/src/lib/elm_general.h index 2ad5d2dea0..9f5e140945 100644 --- a/legacy/elementary/src/lib/elm_general.h +++ b/legacy/elementary/src/lib/elm_general.h @@ -126,6 +126,7 @@ typedef enum ELM_OBJECT_SELECT_MODE_ALWAYS, /**< always select mode */ ELM_OBJECT_SELECT_MODE_NONE, /**< no select mode */ ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, /**< no select mode with no finger size rule*/ + ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL, /**< disallow mutiple selection when clicked without control key pressed */ ELM_OBJECT_SELECT_MODE_MAX } Elm_Object_Select_Mode; diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index b315bf53ff..883d4fb9f3 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -596,7 +596,9 @@ _item_mouse_up_cb(void *data, _elm_gengrid_item_unrealize(it, EINA_FALSE); } if (elm_widget_item_disabled_get(it) || (dragged)) return; - if (sd->multi) + if (sd->multi && + ((sd->select_mode != ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL) || + (evas_key_modifier_is_set(ev->modifiers, "Control")))) { if (!it->selected) { diff --git a/legacy/elementary/src/lib/elm_gengrid_legacy.h b/legacy/elementary/src/lib/elm_gengrid_legacy.h index f55edc0cbb..0f09c70d34 100644 --- a/legacy/elementary/src/lib/elm_gengrid_legacy.h +++ b/legacy/elementary/src/lib/elm_gengrid_legacy.h @@ -799,8 +799,12 @@ EAPI Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items * entirely and they will neither appear selected nor call selected * callback functions. + * - ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL : Only one item will be selected + * although multi-selection is enabled, if clicked without pressing control + * key. This mode is only available with multi-selection. * * @see elm_gengrid_select_mode_get() + * @see elm_gengrid_multi_select_set() * * @ingroup Gengrid */ diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index ff3c8b09af..cdb27be35e 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -4220,7 +4220,9 @@ _item_mouse_up_cb(void *data, return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; - if (sd->multi) + if (sd->multi && + ((sd->select_mode != ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL) || + (evas_key_modifier_is_set(ev->modifiers, "Control")))) { if (!it->selected) { diff --git a/legacy/elementary/src/lib/elm_genlist_legacy.h b/legacy/elementary/src/lib/elm_genlist_legacy.h index 3332d322fc..d1a02fc780 100644 --- a/legacy/elementary/src/lib/elm_genlist_legacy.h +++ b/legacy/elementary/src/lib/elm_genlist_legacy.h @@ -575,8 +575,12 @@ EAPI Eina_Bool elm_genlist_tree_effect_enabled_get(const Evas_Object *o * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items * entirely and they will neither appear selected nor call selected * callback functions. + * - ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL : Only one item will be selected + * although multi-selection is enabled, if clicked without pressing control + * key. This mode is only available with multi-selection. * * @see elm_genlist_select_mode_get() + * @see elm_genlist_multi_select_set() * * @ingroup Genlist */