forked from enlightenment/efl
From: Hyoyoung Chang <hyoyoung@gmail.com>
Subject: [E-devel] [patch] elm_gen{list, grid} - add no_highlight_mode_set/get actually change it to hilight_mode/set/get with the inverse. SVN revision: 68947
This commit is contained in:
parent
426c925717
commit
248f878f0d
|
@ -98,6 +98,7 @@ struct _Widget_Data
|
|||
Eina_Bool on_hold : 1;
|
||||
Eina_Bool multi : 1; /**< a flag for item multi selection */
|
||||
Eina_Bool wasselected : 1;
|
||||
Eina_Bool no_highlight : 1;
|
||||
Eina_Bool clear_me : 1; /**< a flag whether genlist is marked as to be cleared or not. if this flag is true, genlist clear was already deferred. */
|
||||
Eina_Bool h_bounce : 1;
|
||||
Eina_Bool v_bounce : 1;
|
||||
|
|
|
@ -916,7 +916,9 @@ _mouse_up(void *data,
|
|||
static void
|
||||
_item_highlight(Elm_Gen_Item *it)
|
||||
{
|
||||
if ((it->wd->select_mode == ELM_OBJECT_NO_SELECT) || (it->generation < it->wd->generation) || (it->highlighted)) return;
|
||||
if ((it->wd->select_mode == ELM_OBJECT_NO_SELECT) ||
|
||||
(it->wd->no_highlight) || (it->highlighted) ||
|
||||
(it->generation < it->wd->generation)) return;
|
||||
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
|
||||
it->highlighted = EINA_TRUE;
|
||||
}
|
||||
|
@ -2857,3 +2859,17 @@ elm_gengrid_select_mode_get(const Evas_Object *obj)
|
|||
{
|
||||
return elm_genlist_select_mode_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_gengrid_hilight_mode_set(Evas_Object *obj,
|
||||
Eina_Bool hilight)
|
||||
{
|
||||
elm_genlist_hilight_mode_set(obj, hilight);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_gengrid_hilight_mode_get(const Evas_Object *obj)
|
||||
{
|
||||
return elm_genlist_hilight_mode_get(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -1463,6 +1463,43 @@ elm_gengrid_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode_Type mode);
|
|||
EAPI Elm_Object_Select_Mode_Type
|
||||
elm_gengrid_select_mode_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Set whether the gengrid items' should be hilighted when item selected.
|
||||
*
|
||||
* @param obj The gengrid object.
|
||||
* @param hilight @c EINA_TRUE to enable hilight or @c EINA_FALSE to
|
||||
* disable it.
|
||||
*
|
||||
* This will turn on/off the hilight effect when items are selected and
|
||||
* they will or will not be hilighted. The selected and clicked
|
||||
* callback functions will still be called.
|
||||
*
|
||||
* hilight is enabled by default.
|
||||
*
|
||||
* @see elm_gengrid_hilight_mode_get().
|
||||
*
|
||||
* @ingroup Gengrid
|
||||
*/
|
||||
|
||||
EAPI void
|
||||
elm_gengrid_hilight_mode_set(Evas_Object *obj,
|
||||
Eina_Bool hilight);
|
||||
|
||||
/**
|
||||
* Get whether the gengrid items' should be hilighted when item selected.
|
||||
*
|
||||
* @param obj The gengrid object.
|
||||
* @return @c EINA_TRUE means items can be hilighted. @c EINA_FALSE indicates
|
||||
* they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
|
||||
*
|
||||
* @see elm_gengrid_hilight_mode_set() for details.
|
||||
*
|
||||
* @ingroup Gengrid
|
||||
*/
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_gengrid_hilight_mode_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -689,6 +689,7 @@ _item_highlight(Elm_Gen_Item *it)
|
|||
{
|
||||
const char *selectraise;
|
||||
if ((it->wd->select_mode == ELM_OBJECT_NO_SELECT) ||
|
||||
(it->wd->no_highlight) ||
|
||||
(it->generation < it->wd->generation) ||
|
||||
(it->highlighted) || elm_widget_item_disabled_get(it) ||
|
||||
(it->display_only) || (it->item->mode_view))
|
||||
|
@ -5739,6 +5740,26 @@ elm_genlist_select_mode_get(const Evas_Object *obj)
|
|||
return wd->select_mode;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_genlist_hilight_mode_set(Evas_Object *obj,
|
||||
Eina_Bool hilight)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
hilight = !!hilight;
|
||||
wd->no_highlight = !hilight;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_genlist_hilight_mode_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return EINA_FALSE;
|
||||
return !wd->no_highlight;
|
||||
}
|
||||
|
||||
/* for gengrid as of now */
|
||||
void
|
||||
_elm_genlist_page_relative_set(Evas_Object *obj,
|
||||
|
|
|
@ -1890,6 +1890,43 @@ elm_genlist_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode_Type mode);
|
|||
EAPI Elm_Object_Select_Mode_Type
|
||||
elm_genlist_select_mode_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Set whether the genlist items' should be highlighted when item selected.
|
||||
*
|
||||
* @param obj The genlist object.
|
||||
* @param hilight @c EINA_TRUE to enable hilighting or @c EINA_FALSE to
|
||||
* disable it.
|
||||
*
|
||||
* This will turn on/off the highlight effect when item selection and
|
||||
* they will, or will not highlighted. The selected and clicked
|
||||
* callback functions will still be called.
|
||||
*
|
||||
* Highlight is enabled by default.
|
||||
*
|
||||
* @see elm_genlist_hilight_mode_get().
|
||||
*
|
||||
* @ingroup Genlist
|
||||
*/
|
||||
|
||||
EAPI void
|
||||
elm_genlist_hilight_mode_set(Evas_Object *obj,
|
||||
Eina_Bool hilight);
|
||||
|
||||
/**
|
||||
* Get whether the genlist items' should be hilighted when item selected.
|
||||
*
|
||||
* @param obj The genlist object.
|
||||
* @return @c EINA_TRUE means items can be hilighted. @c EINA_FALSE indicates
|
||||
* they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
|
||||
*
|
||||
* @see elm_genlist_hilight_mode_set() for details.
|
||||
*
|
||||
* @ingroup Genlist
|
||||
*/
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_genlist_hilight_mode_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue