forked from enlightenment/efl
elementary/index - [E-devel] [Patch] Add new API in Index widget (e lm_index_indicator_disabled_set/get())
I've attached patch file about new API in Index widget. called elm_index_indicator_disabled_set() / elm_index_indicator_disabled_get() Using this elm_index_indicator_disabled_set API, if it is set EINA_TRUE in second value, popup text could be invisible. In this API, indicator notes popup text which shows a letter has been selecting. I tested through elementary_test, and it works. Signed-Off-By GoUn Lee<gouni.lee@samsung.com> SVN revision: 68559
This commit is contained in:
parent
475eb70299
commit
2e5b1279ca
|
@ -18,6 +18,7 @@ struct _Widget_Data
|
|||
Eina_Bool horizontal : 1;
|
||||
Eina_Bool active : 1;
|
||||
Eina_Bool down : 1;
|
||||
Eina_Bool indicator_disabled : 1;
|
||||
};
|
||||
|
||||
struct _Elm_Index_Item
|
||||
|
@ -459,7 +460,7 @@ _mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *eve
|
|||
_sel_eval(data, ev->canvas.x, ev->canvas.y);
|
||||
edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer",
|
||||
(!edje_object_mirrored_get(wd->base)) ? wd->dx : (wd->dx - w), wd->dy);
|
||||
if (wd->items)
|
||||
if (wd->items && !wd->indicator_disabled)
|
||||
edje_object_signal_emit(wd->base, "elm,indicator,state,active", "elm");
|
||||
}
|
||||
|
||||
|
@ -476,6 +477,7 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event
|
|||
if (item) evas_object_smart_callback_call(data, SIG_SELECTED, item);
|
||||
elm_index_active_set(data, 0);
|
||||
edje_object_signal_emit(wd->base, "elm,state,level,0", "elm");
|
||||
if (wd->items && !wd->indicator_disabled)
|
||||
edje_object_signal_emit(wd->base, "elm,indicator,state,inactive", "elm");
|
||||
}
|
||||
|
||||
|
@ -546,6 +548,7 @@ elm_index_add(Evas_Object *parent)
|
|||
elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
|
||||
elm_widget_can_focus_set(obj, EINA_FALSE);
|
||||
|
||||
wd->indicator_disabled = EINA_FALSE;
|
||||
wd->horizontal = EINA_FALSE;
|
||||
|
||||
wd->base = edje_object_add(e);
|
||||
|
@ -823,6 +826,33 @@ elm_index_item_data_set(Elm_Object_Item *it, const void *data)
|
|||
elm_object_item_data_set(it, (void *) data);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_index_indicator_disabled_set(Evas_Object *obj, Eina_Bool disabled)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
disabled = !!disabled;
|
||||
if (wd->indicator_disabled == disabled) return;
|
||||
wd->indicator_disabled = disabled;
|
||||
if (!wd->items) return;
|
||||
if (disabled)
|
||||
edje_object_signal_emit(wd->base, "elm,indicator,state,inactive", "elm");
|
||||
else
|
||||
edje_object_signal_emit(wd->base, "elm,indicator,state,active", "elm");
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_index_indicator_disabled_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->indicator_disabled;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_index_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func)
|
||||
{
|
||||
|
|
|
@ -285,6 +285,32 @@ EAPI void elm_index_item_go(Evas_Object *obj, int level);
|
|||
*/
|
||||
EAPI const char *elm_index_item_letter_get(const Elm_Object_Item *item);
|
||||
|
||||
/**
|
||||
* Set the indicator as to be disabled.
|
||||
*
|
||||
* @param obj The index object
|
||||
* @param disabled @c EINA_TRUE to disable it, @c EINA_FALSE to enable it
|
||||
*
|
||||
* In Index widget, Indicator notes popup text, which shows a letter has been selecting.
|
||||
*
|
||||
* @see elm_index_indicator_disabled_get()
|
||||
*
|
||||
* @ingroup Index
|
||||
*/
|
||||
EAPI void elm_index_indicator_disabled_set(Evas_Object *obj, Eina_Bool disabled);
|
||||
|
||||
/**
|
||||
* Get the value of indicator's disabled status.
|
||||
*
|
||||
* @param obj The index object
|
||||
* @return EINA_TRUE if the indicator is disabled.
|
||||
*
|
||||
* @see elm_index_indicator_disabled_set()
|
||||
*
|
||||
* @ingroup Index
|
||||
*/
|
||||
EAPI Eina_Bool elm_index_indicator_disabled_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue