Eina_Bool selected : 1;
Eina_Bool highlighted : 1;
Eina_Bool expanded : 1;
- Eina_Bool disabled : 1;
Eina_Bool display_only : 1;
Eina_Bool mincalcd : 1;
Eina_Bool queued : 1;
}
static void
+_elm_genlist_item_state_update(Elm_Genlist_Item *it, Item_Cache *itc)
+{
+ if (itc)
+ {
+ if (it->selected != itc->selected)
+ {
+ if (it->selected)
+ {
+ edje_object_signal_emit(VIEW(it),
+ "elm,state,selected", "elm");
+ if (it->edit_obj)
+ edje_object_signal_emit(it->edit_obj,
+ "elm,state,selected", "elm");
+ }
+ }
+ if (elm_widget_item_disabled_get(it) != itc->disabled)
+ {
+ if (elm_widget_item_disabled_get(it))
+ {
+ edje_object_signal_emit(VIEW(it),
+ "elm,state,disabled", "elm");
+ if (it->edit_obj)
+ edje_object_signal_emit(it->edit_obj,
+ "elm,state,disabled", "elm");
+ }
+ }
+ if (it->expanded != itc->expanded)
+ {
+ if (it->expanded)
+ {
+ edje_object_signal_emit(VIEW(it),
+ "elm,state,expanded", "elm");
+ if (it->edit_obj)
+ edje_object_signal_emit(it->edit_obj,
+ "elm,state,expanded", "elm");
+ }
+ }
+ }
+ else
+ {
+ if (it->selected)
+ {
+ edje_object_signal_emit(VIEW(it),
+ "elm,state,selected", "elm");
+ if (it->edit_obj)
+ edje_object_signal_emit(it->edit_obj,
+ "elm,state,selected", "elm");
+ }
+ if (elm_widget_item_disabled_get(it))
+ {
+ edje_object_signal_emit(VIEW(it),
+ "elm,state,disabled", "elm");
+ if (it->edit_obj)
+ edje_object_signal_emit(it->edit_obj,
+ "elm,state,disabled", "elm");
+ }
+ if (it->expanded)
+ {
+ edje_object_signal_emit(VIEW(it),
+ "elm,state,expanded", "elm");
+ if (it->edit_obj)
+ edje_object_signal_emit(it->edit_obj,
+ "elm,state,expanded", "elm");
+ }
+ }
+}
+
+static void
_content_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Elm_Genlist_Item *it = data;
elm_widget_sub_object_add(WIDGET(it), ic);
if (it->mode_view || it->wd->edit_mode)
{
- if (it->disabled)
+ if (elm_widget_item_disabled_get(it))
elm_widget_disabled_set(ic, EINA_TRUE);
}
else if (it->renamed)
evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_MULTI_MOVE,
_multi_move, it);
+ _elm_genlist_item_state_update(it, itc);
+
if ((!it->edit_obj) &&(it->wd->edit_mode) &&
(it->flags != ELM_GENLIST_ITEM_GROUP) && (it->itc->edit_item_style))
_effect_item_realize(it, EINA_FALSE);
-
- if (itc)
- {
- if ((it->selected) && (it->selected != itc->selected))
- {
- edje_object_signal_emit(VIEW(it),
- "elm,state,selected", "elm");
- if (it->edit_obj)
- edje_object_signal_emit(it->edit_obj,
- "elm,state,selected", "elm");
- }
- if ((it->disabled) && (it->disabled != itc->disabled))
- {
- edje_object_signal_emit(VIEW(it),
- "elm,state,disabled", "elm");
- if (it->edit_obj)
- edje_object_signal_emit(it->edit_obj,
- "elm,state,disabled", "elm");
- }
- if ((it->expanded) && (it->expanded != itc->expanded))
- {
- edje_object_signal_emit(VIEW(it),
- "elm,state,expanded", "elm");
- if (it->edit_obj)
- edje_object_signal_emit(it->edit_obj,
- "elm,state,expanded", "elm");
- }
- }
- else
- {
- if (it->selected)
- {
- edje_object_signal_emit(VIEW(it),
- "elm,state,selected", "elm");
- if (it->edit_obj)
- edje_object_signal_emit(it->edit_obj,
- "elm,state,selected", "elm");
- }
- if (it->disabled)
- {
- edje_object_signal_emit(VIEW(it),
- "elm,state,disabled", "elm");
- if (it->edit_obj)
- edje_object_signal_emit(it->edit_obj,
- "elm,state,disabled", "elm");
- }
- if (it->expanded)
- {
- edje_object_signal_emit(VIEW(it),
- "elm,state,expanded", "elm");
- if (it->edit_obj)
- edje_object_signal_emit(it->edit_obj,
- "elm,state,expanded", "elm");
- }
- }
}
if ((calc) && (it->wd->homogeneous) &&
vis = (ELM_RECTS_INTERSECT(it->scrl_x, it->scrl_y, it->w, it->h,
cvx, cvy, cvw, cvh));
- if ((itb->realized))
+ if ((itb->realized) && (!it->realized))
{
- if (vis)
- {
- if (!it->realized) _item_realize(it, in, EINA_FALSE);
- }
+ if (vis) _item_realize(it, in, EINA_FALSE);
}
if (it->realized)
{
{
Widget_Data *wd = data;
Item_Block *itb, *chb = NULL;
- Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0;
+ Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0, vw;
Evas_Coord pan_w = 0, pan_h = 0;
int in = 0;
double t0, t;
t0 = ecore_time_get();
evas_object_geometry_get(wd->pan_smart, NULL, NULL, &ow, &wd->h);
+ elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, NULL);
+
if (wd->w != ow)
wd->w = ow;
minw = itb->minw;
minw_change = EINA_TRUE;
}
- if (minw > wd->w)
+ if (minw > vw)
{
- minw = wd->w;
+ minw = vw;
minw_change = EINA_TRUE;
}
itb->w = minw;
evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
_sizing_eval(wd->obj);
#ifdef ANCHOR_ITEM
- if ((wd->anchor_item) && (wd->anchor_item->block) && (wd->auto_scroll_enabled))
+ if ((wd->anchor_item) && (wd->anchor_item->block) && (!wd->auto_scroll_enabled))
{
Elm_Genlist_Item *it;
Evas_Coord it_y;
edje_object_part_swallow(it->mode_view, key, ic);
evas_object_show(ic);
elm_widget_sub_object_add(WIDGET(it), ic);
- if (it->disabled)
+ if (elm_widget_item_disabled_get(it))
elm_widget_disabled_set(ic, EINA_TRUE);
}
}
{
showme = _item_block_recalc(it->block, it->block->num, EINA_TRUE);
it->block->changed = 0;
- if(wd->pan_changed)
+ if (wd->pan_changed)
{
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = NULL;
EAPI Eina_Bool
elm_genlist_item_disabled_get(const Elm_Object_Item *it)
{
- if (((Elm_Genlist_Item *) it)->delete_me) return EINA_FALSE;
return elm_object_item_disabled_get(it);
}
return wd->reorder_mode;
}
+EAPI Elm_Genlist_Item_Flags
+elm_genlist_item_flags_get(const Elm_Object_Item *it)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ELM_GENLIST_ITEM_MAX);
+ Elm_Genlist_Item *_it = (Elm_Genlist_Item *) it;
+ return _it->flags;
+}
+
/* for gengrid as of now */
void
_elm_genlist_page_relative_set(Evas_Object *obj,
if (effect_on) edje_object_signal_emit(it->edit_obj, "elm,state,emode_enabled_effect", "elm");
else edje_object_signal_emit(it->edit_obj, "elm,state,emode_enabled", "elm");
- if (it->disabled) edje_object_signal_emit(it->edit_obj, "elm,state,disabled", "elm");
+ if (elm_widget_item_disabled_get(it)) edje_object_signal_emit(it->edit_obj, "elm,state,disabled", "elm");
else edje_object_signal_emit(it->edit_obj, "elm,state,enabled", "elm");
edje_object_part_swallow(it->edit_obj, key, ic);
evas_object_show(ic);
elm_widget_sub_object_add(WIDGET(it), ic);
- if (it->disabled)
+ if (elm_widget_item_disabled_get(it))
elm_widget_disabled_set(ic, EINA_TRUE);
}
}
*
* @ingroup Genlist
*/
- typedef enum _Elm_Genlist_Item_Flags
- {
- ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
- ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), /**< may expand and have child items */
- ELM_GENLIST_ITEM_GROUP = (1 << 1) /**< index of a group of items */
- } Elm_Genlist_Item_Flags;
+typedef enum _Elm_Genlist_Item_Flags
+{
+ ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
+ ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), /**< may expand and have child items */
+ ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
+
+ ELM_GENLIST_ITEM_MAX = (1 << 2)
+} Elm_Genlist_Item_Flags;
+
typedef enum _Elm_Genlist_Item_Field_Flags
{
ELM_GENLIST_ITEM_FIELD_ALL = 0,
/* operations to retrieve existing items */
/**
- * Get the selectd item in the genlist.
+ * Get the selected item in the genlist.
*
* @param obj The genlist object
* @return The selected item, or NULL if none is selected.
/**
* Get the item that is at the x, y canvas coords.
*
- * @param obj The gelinst object.
+ * @param obj The genlist object.
* @param x The input x coordinate
* @param y The input y coordinate
* @param posret The position relative to the item returned here
* has been expanded/contracted.
*
* Calling this function won't show or hide any child of this item (if it is
- * a parent). You must manually delete and create them on the callbacks fo
+ * a parent). You must manually delete and create them on the callbacks of
* the "expanded" or "contracted" signals.
*
* @see elm_genlist_item_expanded_get()
EAPI void elm_genlist_item_middle_bring_in(Elm_Object_Item *it);
/**
- * Tells genlist to "orphan" contents fetchs by the item class
+ * Tells genlist to "orphan" contents fetched by the item class
*
* @param it The item
*
* @param it The item
* @param itc The item class for the item
*
- * This sets another class fo the item, changing the way that it is
+ * This sets another class of the item, changing the way that it is
* displayed. After changing the item class, elm_genlist_item_update() is
* called on the item @p it.
*
* @param disable If EINA_TRUE, size restrictions are disabled
* @return EINA_FALSE on failure, EINA_TRUE on success
*
- * This function allows a tooltip to expand beyond its parant window's canvas.
+ * This function allows a tooltip to expand beyond its parent window's canvas.
* It will instead be limited only by the size of the display.
*/
EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable);
* @return If EINA_TRUE, size restrictions are disabled
*
* This function returns whether a tooltip is allowed to expand beyond
- * its parant window's canvas.
+ * its parent window's canvas.
* It will instead be limited only by the size of the display.
*/
EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it);
*/
EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj);
+/**
+ * Get the Item's Flags
+ *
+ * @param item The genlist item
+ * @return The item flags.
+ *
+ * This function returns the item's type. Normally the item's type.
+ * If it failed, return value is ELM_GENLIST_ITEM_MAX
+ *
+ * @ingroup Genlist
+ */
+EAPI Elm_Genlist_Item_Flags elm_genlist_item_flags_get(const Elm_Object_Item *it);
+
EAPI void elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode) EINA_ARG_NONNULL(1);
EAPI Eina_Bool elm_genlist_edit_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
EAPI void elm_genlist_item_rename_mode_set(Elm_Object_Item *it, Eina_Bool renamed) EINA_ARG_NONNULL(1);