* details.
*
* An item in the genlist world can have 0 or more text labels (they can be
- * regular text or textblock ??that's up to the style to determine), 0 or
+ * regular text or textblock - that's up to the style to determine), 0 or
* more icons (which are simply objects swallowed into the genlist item) and
* 0 or more boolean states that can be used for check, radio or other
* indicators by the edje theme style. An item may be one of several styles
- * (Elementary provides 4 by default - ?\9cdefault?? ?\9cdouble_label?? "group_index"
+ * (Elementary provides 4 by default - "default", "double_label", "group_index"
* and "icon_top_text_bottom", but this can be extended by system or
* application custom themes/overlays/extensions).
*
* a structure with information about that type of item (genlist may contain
* multiple different items with different classes, states and styles).
* Genlist will call the functions in this struct (methods) when an item is
- * ?\9crealized??(that is created dynamically while scrolling). All objects will
+ * "realized" (that is created dynamically while scrolling). All objects will
* simply be deleted when no longer needed with evas_object_del(). The
* Elm_Genlist_Item_Class structure contains the following members:
*
* item_style - This is a constant string and simply defines the name of the
- * item style. It must be specified and the default should be ?\9cdefault??
+ * item style. It must be specified and the default should be "default".
*
* func.label_get - This function is called when an actual item object is
* created. The data parameter is the data parameter passed to
* parameter is the genlist object and the part parameter is the string name
* of the state part in the edje design that is listed as one of the possible
* states that can be set. Return 0 for false or 1 for true. Genlist will
- * emit a signal to the edje object with ?\9celm,state,XXX,active???\9celm??when
+ * emit a signal to the edje object with "elm,state,XXX,active" "elm" when
* true (the default is false), where XXX is the name of the part.
*
* func.del - This is called when elm_genlist_item_del() is called on an
* handle that is an internal member inside the genlist. They all take a data
* parameter that is meant to be used for a handle to the applications
* internal data (eg the struct with the original item data). The parent
- * parameter is the parent genlist item this belongs to if it is a tree or
+ * parameter is the parent genlist item this belongs to if it is a tree or
* an indexed group, and NULL if there is no parent. The flags can be a bitmask
* of ELM_GENLIST_ITEM_NONE, ELM_GENLIST_ITEM_SUBITEMS and
* ELM_GENLIST_ITEM_GROUP. If ELM_GENLIST_ITEM_SUBITEMS is set then this item
* viewport of the scroller. If it is ELM_LIST_LIMIT, items will be expanded
* to the viewport width and limited to that size. This can be combined with
* a different style that uses edjes' ellipsis feature (cutting text off like
- * this: ?\9ctex...??.
+ * this: "tex...").
*
* Items will only call their selection func and callback when first becoming
* selected. Any further clicks will do nothing, unless you enable always
typedef struct _Item_Block Item_Block;
typedef struct _Pan Pan;
typedef struct _Item_Cache Item_Cache;
+typedef struct _Edit_Data Edit_Data;
typedef enum _Elm_Genlist_Item_Move_effect_Mode
{
Eina_List *group_items;
Pan *pan;
Evas_Coord pan_x, pan_y, w, h, minw, minh, realminw, prev_viewport_w;
- Ecore_Job *calc_job, *update_job, *changed_job;
+ Ecore_Job *calc_job, *update_job;
Ecore_Idler *queue_idler;
Ecore_Idler *must_recalc_idler;
Eina_List *queue, *selected;
int walking;
int item_width;
int item_height;
+ int group_item_width;
+ int group_item_height;
int max_items_per_block;
double longpress_timeout;
Eina_List *sweeped_items;
Ecore_Timer *scr_hold_timer;
int total_num;
- int group_item_width;
- int group_item_height;
Elm_Genlist_Item *reorder_it, *reorder_rel;
Evas_Coord reorder_start_y;
Ecore_Animator *item_moving_effect_timer;
Evas_Coord expand_item_gap;
int move_effect_mode;
unsigned int start_time;
- Elm_Genlist_Item *head_item, *tail_item;
+ Ecore_Job *changed_job;
Elm_Genlist_Item *rename_it;
};
Eina_Bool want_realize : 1;
Eina_Bool realized : 1;
Eina_Bool selected : 1;
- Eina_Bool hilighted : 1;
+ Eina_Bool highlighted : 1;
Eina_Bool expanded : 1;
Eina_Bool disabled : 1;
Eina_Bool display_only : 1;
// TODO: refactoring
Eina_Bool move_effect_me : 1;
- Eina_Bool effect_done : 1;
+ Eina_Bool effect_done : 1;
Eina_Bool reordering : 1;
- Eina_Bool renamed : 1;
- Eina_Bool effect_item_realized : 1;
+ Eina_Bool renamed : 1;
+ Eina_Bool effect_item_realized : 1;
Eina_Bool sweeped : 1;
Eina_Bool wassweeped : 1;
- Eina_List *edit_icon_objs;
+ Eina_List *edit_icon_objs;
Evas_Object *edit_obj;
Eina_List *sweep_labels, *sweep_icons, *sweep_icon_objs;
int num;
Ecore_Animator *item_moving_effect_timer;
Evas_Coord old_scrl_x, old_scrl_y;
- Evas_Coord pad_left, pad_right;
};
struct _Item_Cache
static const char *widtype = NULL;
static void _item_cache_zero(Widget_Data *wd);
static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj,
+ Eina_Bool rtl);
static void _theme_hook(Evas_Object *obj);
-static void _show_region_hook(void *data, Evas_Object *obj);
+static void _show_region_hook(void *data,
+ Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _item_unrealize(Elm_Genlist_Item *it);
static void _item_block_unrealize(Item_Block *itb);
}
static void
+_mirrored_set(Evas_Object *obj,
+ Eina_Bool rtl)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ _item_cache_zero(wd);
+ // TODO: uncomment this after upstream merge
+ //elm_smart_scroller_mirrored_set(wd->scr, rtl);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Item_Block *itb;
if (!wd) return;
_item_cache_zero(wd);
+ // TODO: uncomment this after upstream merge
+ //_elm_widget_mirrored_reload(obj);
+ //_mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base",
elm_widget_style_get(obj));
// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
wd->item_width = wd->item_height = 0;
+ wd->group_item_width = wd->group_item_height = 0;
wd->minw = wd->minh = wd->realminw = 0;
EINA_INLIST_FOREACH(wd->blocks, itb)
- {
- Eina_List *l;
- Elm_Genlist_Item *it;
+ {
+ Eina_List *l;
+ Elm_Genlist_Item *it;
- if (itb->realized) _item_block_unrealize(itb);
- EINA_LIST_FOREACH(itb->items, l, it)
- it->mincalcd = EINA_FALSE;
+ if (itb->realized) _item_block_unrealize(itb);
+ EINA_LIST_FOREACH(itb->items, l, it)
+ it->mincalcd = EINA_FALSE;
- itb->changed = EINA_TRUE;
- }
+ itb->changed = EINA_TRUE;
+ }
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
_sizing_eval(obj);
}
static void
-_show_region_hook(void *data, Evas_Object *obj)
+_show_region_hook(void *data,
+ Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(data);
Evas_Coord x, y, w, h;
if (!wd) return;
elm_widget_show_region_get(obj, &x, &y, &w, &h);
+ //x & y are screen coordinates, Add with pan coordinates
x += wd->pan_x;
y += wd->pan_y;
if (y > 0) elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
wd->prev_viewport_w = vw;
EINA_INLIST_FOREACH(wd->blocks, itb)
- {
- itb->must_recalc = EINA_TRUE;
- }
+ {
+ itb->must_recalc = EINA_TRUE;
+ }
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
}
}
static void
-_item_hilight(Elm_Genlist_Item *it)
+_item_highlight(Elm_Genlist_Item *it)
{
const char *selectraise;
- if ((it->wd->no_select) || (it->delete_me) || (it->hilighted) || (it->disabled) || (it->display_only)) return;
+ if ((it->wd->no_select) || (it->delete_me) || (it->highlighted) || (it->disabled) || (it->display_only)) return;
if ((!it->sweeped) && (!it->wd->edit_mode))
edje_object_signal_emit(it->base.view, "elm,state,selected", "elm");
selectraise = edje_object_data_get(it->base.view, "selectraise");
if ((it->group_item) && (it->group_item->realized))
evas_object_raise(it->group_item->base.view);
}
- it->hilighted = EINA_TRUE;
+ it->highlighted = EINA_TRUE;
}
static void
if (!it) return;
Eina_List *tl = NULL, *l;
Elm_Genlist_Item *it2;
-
+
EINA_LIST_FOREACH(it->items, l, it2)
tl = eina_list_append(tl, it2);
it->wd->anchor_item = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
}
#endif
- if (it->flags != ELM_GENLIST_ITEM_HEAD)
it->wd->items = eina_inlist_remove(it->wd->items, EINA_INLIST_GET(it));
if (it->parent)
it->parent->items = eina_list_remove(it->parent->items, it);
if (it->tooltip.del_cb)
it->tooltip.del_cb((void *)it->tooltip.data, it->base.widget, it);
- if (it->flags & ELM_GENLIST_ITEM_HEAD) it->wd->head_item = NULL;
elm_widget_item_del(it);
it->wd->total_num--; // todo : remove
_item_unselect(Elm_Genlist_Item *it)
{
const char *stacking, *selectraise;
-
- if ((it->delete_me) || (!it->hilighted)) return;
+
+ if ((it->delete_me) || (!it->highlighted)) return;
if (!it->sweeped)
edje_object_signal_emit(it->base.view, "elm,state,unselected", "elm");
stacking = edje_object_data_get(it->base.view, "stacking");
if ((stacking) && (!strcmp(stacking, "below")))
evas_object_lower(it->base.view);
}
- it->hilighted = EINA_FALSE;
+ it->highlighted = EINA_FALSE;
if (it->selected)
{
it->selected = EINA_FALSE;
Evas_Event_Mouse_Move *ev = event_info;
Evas_Coord minw = 0, minh = 0, x, y, dx, dy, adx, ady;
- if (it->renamed) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
{
if (!it->wd->on_hold)
}
if (it->wd->reorder_mode && it->wd->reorder_it)
{
- Evas_Coord ox,oy,oh,ow, sel_all_h = 0;
+ Evas_Coord ox,oy,oh,ow;
evas_object_geometry_get(it->wd->pan_smart, &ox, &oy, &ow, &oh);
int it_y = ev->cur.canvas.y - it->wd->reorder_it->dy;
if (!it->wd->reorder_start_y) it->wd->reorder_start_y = it->block->y + it->y;
- evas_object_resize(it->base.view, it->w-(it->pad_left+it->pad_right), it->h);
- if (it->wd->head_item)
- sel_all_h = it->wd->head_item->h;
- if (it_y < oy + sel_all_h) _effect_item_controls(it, it->scrl_x, oy + sel_all_h);
+ evas_object_resize(it->base.view, it->w, it->h);
+ if (it_y < oy) _effect_item_controls(it, it->scrl_x, oy);
else if (it_y + it->wd->reorder_it->h > oy+oh) _effect_item_controls(it, it->scrl_x, oy + oh - it->wd->reorder_it->h);
else _effect_item_controls(it, it->scrl_x, it_y);
Elm_Genlist_Item *it_tmp;
static Eina_Bool done = EINA_FALSE;
//static Eina_Bool contracted = EINA_FALSE;
- Eina_List *l;
- Item_Block *itb;
+ Eina_List *l;
+ Item_Block *itb;
it->long_timer = NULL;
if ((it->disabled) || (it->dragging) || (it->display_only) || (it->wd->rename_it))
- return ECORE_CALLBACK_CANCEL;
+ return ECORE_CALLBACK_CANCEL;
it->wd->longpressed = EINA_TRUE;
evas_object_smart_callback_call(it->base.widget, "longpressed", it);
- if ((it->wd->reorder_mode) && (it != it->wd->head_item) && (it->flags != ELM_GENLIST_ITEM_GROUP))
+ if ((it->wd->reorder_mode) && (it->flags != ELM_GENLIST_ITEM_GROUP))
{
it->wd->reorder_it = it;
it->wd->reorder_start_y = 0;
{
EINA_LIST_FOREACH(it->items, l, it_tmp)
{
- if (elm_genlist_item_expanded_get(it_tmp))
+ if (elm_genlist_item_expanded_get(it_tmp))
{
elm_genlist_item_expanded_set(it_tmp, EINA_FALSE);
return ECORE_CALLBACK_RENEW;
- }
+ }
}
}
if (elm_genlist_item_expanded_get(it)) {
int i, sum = 0;
if (!it) return;
+ if ((it->display_only) || (it->disabled)) return;
it->wd->swipe = EINA_FALSE;
for (i = 0; i < it->wd->movements; i++)
{
}
if (it->wd->multi_timeout)
{
- it->wd->multi_timeout = EINA_FALSE;
- return;
+ it->wd->multi_timeout = EINA_FALSE;
+ return;
}
Evas_Coord minw = 0, minh = 0;
"multi,pinch,in", it);
}
}
- it->wd->multi_timeout = EINA_FALSE;
+ it->wd->multi_timeout = EINA_FALSE;
}
static void
-_multi_down(void *data,
- Evas *evas __UNUSED__,
+_multi_down(void *data,
+ Evas *evas __UNUSED__,
Evas_Object *obj __UNUSED__,
- void *event_info)
+ void *event_info)
{
Elm_Genlist_Item *it = data;
Evas_Event_Multi_Down *ev = event_info;
}
static void
-_multi_up(void *data,
- Evas *evas __UNUSED__,
+_multi_up(void *data,
+ Evas *evas __UNUSED__,
Evas_Object *obj __UNUSED__,
- void *event_info)
+ void *event_info)
{
Elm_Genlist_Item *it = data;
Evas_Event_Multi_Up *ev = event_info;
}
static void
-_multi_move(void *data,
- Evas *evas __UNUSED__,
+_multi_move(void *data,
+ Evas *evas __UNUSED__,
Evas_Object *obj __UNUSED__,
- void *event_info)
+ void *event_info)
{
Elm_Genlist_Item *it = data;
Evas_Event_Multi_Move *ev = event_info;
Evas_Event_Mouse_Down *ev = event_info;
Evas_Coord x, y;
- if (it->renamed) return;
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
{
it->wd->on_hold = EINA_TRUE;
}
- if (it->wd->rename_it) elm_genlist_item_rename_mode_set(it, EINA_FALSE);
it->down = EINA_TRUE;
it->dragging = EINA_FALSE;
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
else it->wd->on_hold = EINA_FALSE;
if (it->wd->on_hold) return;
it->wd->wasselected = it->selected;
- _item_hilight(it);
+ _item_highlight(it);
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
- evas_object_smart_callback_call(it->base.widget, "clicked", it);
+ if ((!it->disabled) && (!it->display_only))
+ evas_object_smart_callback_call(it->base.widget, "clicked", 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_Event_Mouse_Up *ev = event_info;
Eina_Bool dragged = EINA_FALSE;
- if (it->renamed) return;
if (ev->button != 1) return;
it->down = EINA_FALSE;
it->wd->mouse_down = EINA_FALSE;
}
if (it->wd->reorder_mode)
{
- Evas_Coord rox, roy, row, roh, sel_all_h = 0;
+ Evas_Coord rox, roy, row, roh;
Elm_Genlist_Item *reorder_it = it->wd->reorder_it;
if (reorder_it)
{
Evas_Coord ox,oy,oh,ow;
evas_object_geometry_get(it->wd->pan_smart, &ox, &oy, &ow, &oh);
evas_object_geometry_get(it->wd->reorder_it->base.view, &rox, &roy, &row, &roh);
- if (it->wd->head_item) sel_all_h = it->wd->head_item->h;
if (it->wd->reorder_rel)
- {
+ {
if (it->wd->reorder_it->parent == it->wd->reorder_rel->parent) // todo : refactoring
{
- if (roy + oy - sel_all_h <= it->wd->reorder_rel->scrl_y)
+ if (roy + oy <= it->wd->reorder_rel->scrl_y)
_effect_item_move_before(it->wd->reorder_it, it->wd->reorder_rel);
else
_effect_item_move_after(it->wd->reorder_it, it->wd->reorder_rel);
{
if ((!it->selected) && (!it->sweeped))
{
- _item_hilight(it);
+ _item_highlight(it);
_item_select(it);
}
else _item_unselect(it);
EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, it2)
if (it2 != it) _item_unselect(it2);
- //_item_hilight(it);
+ //_item_highlight(it);
//_item_select(it);
}
if (!it->sweeped)
{
- _item_hilight(it);
+ _item_highlight(it);
_item_select(it);
}
}
if (it->flags & ELM_GENLIST_ITEM_SUBITEMS) tree = 1;
odd = (it->order_num_in & 0x1);
EINA_INLIST_FOREACH(it->wd->item_cache, itc)
- {
- if ((itc->selected) || (itc->disabled) || (itc->expanded))
- continue;
- if ((itc->tree == tree) &&
- (itc->odd == odd) &&
- (itc->compress == it->wd->compress) &&
- (!strcmp(it->itc->item_style, itc->item_style)))
- {
- it->wd->item_cache = eina_inlist_remove(it->wd->item_cache,
- EINA_INLIST_GET(itc));
- it->wd->item_cache_count--;
- return itc;
- }
- }
+ {
+ if ((itc->selected) || (itc->disabled) || (itc->expanded))
+ continue;
+ if ((itc->tree == tree) &&
+ (itc->odd == odd) &&
+ (itc->compress == it->wd->compress) &&
+ (!strcmp(it->itc->item_style, itc->item_style)))
+ {
+ it->wd->item_cache = eina_inlist_remove(it->wd->item_cache,
+ EINA_INLIST_GET(itc));
+ it->wd->item_cache_count--;
+ return itc;
+ }
+ }
return NULL;
}
static void
_item_realize(Elm_Genlist_Item *it,
int in,
- int calc)
+ Eina_Bool calc)
{
Elm_Genlist_Item *it2;
const char *stacking;
if ((it->realized) || (it->delete_me)) return;
it->order_num_in = in;
if (it->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_DELETE) calc = EINA_FALSE;
- if (it->nocache)
- it->nocache = EINA_FALSE;
+ if (it->nocache && !it->renamed)
+ it->nocache = EINA_FALSE;
else
itc = _item_cache_find(it);
if ((!it->wd->effect_mode) && (itc))
_elm_theme_object_set(it->base.widget, it->base.view, "genlist", buf,
elm_widget_style_get(it->base.widget));
+ // TODO: uncomment this after upstream merge
+ //edje_object_mirrored_set(it->base.view,
+ // elm_widget_mirrored_get(it->base.widget));
it->spacer =
evas_object_rectangle_add(evas_object_evas_get(it->base.widget));
evas_object_color_set(it->spacer, 0, 0, 0, 0);
}
}
- if ((calc) && (it->wd->homogeneous) && (it->wd->item_width) && it->wd->group_item_width )
+ if ((calc) && (it->wd->homogeneous) && ((it->wd->item_width) || ((it->wd->item_width) && (it->wd->group_item_width))))
{
/* homogenous genlist shortcut */
- if ((it->flags & ELM_GENLIST_ITEM_GROUP) && (!it->mincalcd))
- {
- it->w = it->minw = it->wd->group_item_width;
- it->h = it->minh = it->wd->group_item_height;
- it->mincalcd = EINA_TRUE;
- }
- else if (!it->mincalcd)
- {
- it->w = it->minw = it->wd->item_width;
- it->h = it->minh = it->wd->item_height;
- it->mincalcd = EINA_TRUE;
- }
+ if (!it->mincalcd)
+ {
+ if (it->flags & ELM_GENLIST_ITEM_GROUP)
+ {
+ it->w = it->minw = it->wd->group_item_width;
+ it->h = it->minh = it->wd->group_item_height;
+ }
+ else
+ {
+ it->w = it->minw = it->wd->item_width;
+ it->h = it->minh = it->wd->item_height;
+ }
+ it->mincalcd = EINA_TRUE;
+ }
}
else
{
it->h = it->minh = mh;
it->mincalcd = EINA_TRUE;
- if ((it->wd->homogeneous) && (it->flags & ELM_GENLIST_ITEM_GROUP))
- {
- it->wd->group_item_width = mw;
- it->wd->group_item_height = mh;
- }
- else if ((it->wd->homogeneous))
- // if ((!in) && (it->wd->homogeneous))
+ if ((!it->wd->group_item_width) && (it->flags == ELM_GENLIST_ITEM_GROUP))
+ {
+ it->wd->group_item_width = mw;
+ it->wd->group_item_height = mh;
+ }
+ else if ((!it->wd->item_width) && (it->flags == ELM_GENLIST_ITEM_NONE))
{
it->wd->item_width = mw;
it->wd->item_height = mh;
}
- if ((!in) && (it->wd->homogeneous) && (!it->wd->group_item_width))
- {
- if (it->flags & ELM_GENLIST_ITEM_GROUP)
- {
- it->wd->group_item_width = mw;
- it->wd->group_item_height = mh;
- }
- }
}
if (!calc) evas_object_show(it->base.view);
}
if (itc) _item_cache_free(itc);
evas_object_smart_callback_call(it->base.widget, "realized", it);
- if ((!calc) && (it->wd->edit_mode) && (it->flags != ELM_GENLIST_ITEM_GROUP) && (it->flags != ELM_GENLIST_ITEM_HEAD))
+ if ((!calc) && (it->wd->edit_mode) && (it->flags != ELM_GENLIST_ITEM_GROUP))
{
- if (it->itc->edit_item_style )
- {
- _effect_item_realize(it, EINA_FALSE);
- edje_object_message_signal_process(it->edit_obj);
+ if (it->itc->edit_item_style )
+ {
+ _effect_item_realize(it, EINA_FALSE);
+ edje_object_message_signal_process(it->edit_obj);
+ }
}
}
-}
static void
_item_unrealize(Elm_Genlist_Item *it)
it->spacer = NULL;
}
else
- _item_cache_add(it);
+ {
+ // TODO: uncomment this after upstream merge
+ //edje_object_mirrored_set(it->base.view, elm_widget_mirrored_get(it->base.widget));
+ _item_cache_add(it);
+ }
elm_widget_stringlist_free(it->labels);
it->labels = NULL;
elm_widget_stringlist_free(it->icons);
if (it->wd->edit_mode) _effect_item_unrealize(it);
}
-static Eina_Bool
+static Eina_Bool
_item_block_recalc(Item_Block *itb,
int in,
int qadd,
if (!it->mincalcd) changed = EINA_TRUE;
if (changed)
{
- _item_realize(it, in, 1);
+ _item_realize(it, in, EINA_TRUE);
_item_unrealize(it);
}
}
else
{
- _item_realize(it, in, 1);
+ _item_realize(it, in, EINA_TRUE);
if (!it->wd->contracting) _item_unrealize(it);
}
}
else
- _item_realize(it, in, 0);
+ _item_realize(it, in, EINA_FALSE);
minh += it->minh;
if (minw < it->minw) minw = it->minw;
in++;
EINA_LIST_FOREACH(itb->items, l, it)
{
if (it->delete_me) continue;
- if (full) _item_realize(it, in, 0);
+ if (full) _item_realize(it, in, EINA_FALSE);
in++;
}
itb->realized = EINA_TRUE;
{
it->block->reorder_offset = it->wd->reorder_it->h;
}
- else
+ else
it->block->reorder_offset = 0;
it->scrl_y += it->block->reorder_offset;
-
+
top = (ELM_RECTS_INTERSECT(it->scrl_x, it->scrl_y, it->w, it->h,
rox, roy+roh/2, row, 1));
if (top)
double time = 0.4, t;
int y, dy = 4;
t = ((0.0 > (t = current_time_get() - it->wd->start_time)) ? 0.0 : t) / 1000;
-
+
if (t <= time)
y = (1 * sin((t / time) * (M_PI / 2)) * dy);
else
it->old_scrl_y += y;
down = EINA_TRUE;
}
- else if (it->old_scrl_y > it->scrl_y)
+ else if (it->old_scrl_y > it->scrl_y)
{
it->old_scrl_y -= y;
down = EINA_FALSE;
- }
+ }
_effect_item_controls(it, it->scrl_x, it->old_scrl_y);
Elm_Genlist_Item *git;
Evas_Coord y = 0, ox, oy, ow, oh, cvx, cvy, cvw, cvh;
int vis = 0;
- int sel_all_h = 0;
- Elm_Genlist_Item *head_item = itb->wd->head_item;
evas_object_geometry_get(itb->wd->pan_smart, &ox, &oy, &ow, &oh);
evas_output_viewport_get(evas_object_evas_get(itb->wd->obj), &cvx, &cvy,
&cvw, &cvh);
- if (head_item)
- {
- if (!head_item->realized)
- {
- _item_realize(head_item, 0, 0);
- itb->wd->minh += itb->wd->head_item->h;
- }
- evas_object_resize(head_item->base.view, itb->w, head_item->h);
- evas_object_move(head_item->base.view, ox, oy);
- evas_object_raise(head_item->base.view);
-
- y = head_item->h;
- sel_all_h = head_item->h;
- }
EINA_LIST_FOREACH(itb->items, l, it)
{
if (it->delete_me) continue;
if (git)
{
git->scrl_x = it->scrl_x;
- if (git->scrl_y < oy + sel_all_h)
- git->scrl_y = oy + sel_all_h;
+ if (git->scrl_y < oy)
+ git->scrl_y = oy;
if ((git->scrl_y + git->h) > (it->scrl_y + it->h))
- git->scrl_y = (it->scrl_y + it->h) - git->h;
+ git->scrl_y = (it->scrl_y + it->h) - git->h;
git->want_realize = EINA_TRUE;
}
if (it->wd->reorder_it && !it->wd->reorder_pan_move && it->old_scrl_y && it->old_scrl_y != it->scrl_y)
if (!it->wd->effect_mode || it->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_NONE || ((it->wd->move_effect_mode != ELM_GENLIST_ITEM_MOVE_EFFECT_DELETE) && it->parent == it->wd->expand_item))
{
if (it->wd->edit_mode && it->itc->edit_item_style)
- {
+ {
_effect_item_controls(it, it->scrl_x, it->scrl_y);
}
else
{
- evas_object_resize(it->base.view, it->w-(it->pad_left+it->pad_right), it->h);
- evas_object_move(it->base.view, it->scrl_x+it->pad_left, it->scrl_y);
+ evas_object_resize(it->base.view, it->w, it->h);
+ evas_object_move(it->base.view, it->scrl_x, it->scrl_y);
if((!it->wd->effect_mode || it->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_NONE) || ((it->wd->move_effect_mode != ELM_GENLIST_ITEM_MOVE_EFFECT_NONE) && (it->old_scrl_y == it->scrl_y)))
evas_object_show(it->base.view);
else
EINA_LIST_FOREACH(wd->group_items, l, git)
{
- if (git->want_realize)
+ if (git->want_realize)
{
if (!git->realized)
- _item_realize(git, 0, 0);
+ _item_realize(git, 0, EINA_FALSE);
evas_object_resize(git->base.view, wd->minw, git->h);
evas_object_move(git->base.view, git->scrl_x, git->scrl_y);
evas_object_show(git->base.view);
}
else if (!git->want_realize && git->realized)
{
- if (!git->dragging)
- _item_unrealize(git);
+ if (!git->dragging)
+ _item_unrealize(git);
}
}
}
}
EINA_INLIST_FOREACH(wd->blocks, itb)
- {
- Eina_Bool showme = EINA_FALSE;
+ {
+ Eina_Bool showme = EINA_FALSE;
itb->num = in;
showme = itb->showme;
if (minw_change)
{
EINA_INLIST_FOREACH(wd->blocks, itb)
- {
- itb->minw = minw;
- itb->w = itb->minw;
- }
+ {
+ itb->minw = minw;
+ itb->w = itb->minw;
+ }
}
if ((chb) && (EINA_INLIST_GET(chb)->next))
{
EINA_INLIST_FOREACH(EINA_INLIST_GET(chb)->next, itb)
- {
- if (itb->realized) _item_block_unrealize(itb);
- }
+ {
+ if (itb->realized) _item_block_unrealize(itb);
+ }
}
wd->realminw = minw;
if (minw < wd->w) minw = wd->w;
- if ((minw != wd->minw) || (minh != wd->minh) || (wd->head_item))
+ if ((minw != wd->minw) || (minh != wd->minh))
{
wd->minw = minw;
wd->minh = minh;
- if (wd->head_item) wd->minh += wd->head_item->h;
if (wd->move_effect_mode != ELM_GENLIST_ITEM_MOVE_EFFECT_DELETE)
evas_object_smart_callback_call(wd->pan_smart, "changed", NULL);
_sizing_eval(wd->obj);
if (!wd) return;
wd->update_job = NULL;
num = 0;
- if (wd->head_item)
- {
- _item_unrealize(wd->head_item);
- _item_realize(wd->head_item, 0, 0);
- position = EINA_TRUE;
- }
EINA_INLIST_FOREACH(wd->blocks, itb)
{
Evas_Coord itminw, itminh;
}
}
done:
-#endif
+#endif
if(!sd->wd->item_moving_effect_timer) evas_object_smart_changed(obj);
}
old_pan_y = sd->wd->pan_y;
}
- if (sd->wd->effect_mode &&
+ if (sd->wd->effect_mode &&
((sd->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND) ||
(sd->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT) ||
(sd->wd->move_effect_mode == ELM_GENLIST_ITEM_MOVE_EFFECT_DELETE)))
}
}
else _item_auto_scroll(sd->wd);
- if (sd->wd->head_item) evas_object_raise(sd->wd->head_item->base.view);
sd->wd->contracting = EINA_FALSE;
}
&minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
+ // TODO: uncomment this after upstream merge
+ //_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
}
}
static int
-_queue_proecess(Widget_Data *wd,
- int norender)
+_queue_process(Widget_Data *wd,
+ int norender)
{
int n;
Eina_Bool showme = EINA_FALSE;
//if (q_start == 0.0) q_start = ecore_time_get();
//xxx
- if (_queue_proecess(wd, 1) > 0)
+ if (_queue_process(wd, 1) > 0)
{
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
ecore_idler_del(wd->queue_idler);
wd->queue_idler = NULL;
}
- _queue_proecess(wd, 0);
+ _queue_process(wd, 0);
}
if (!wd->queue_idler) wd->queue_idler = ecore_idler_add(_item_idler, wd);
}
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
func_data);
- if (!wd) return NULL;
if (!it) return NULL;
if (!it->parent)
{
- if (flags & ELM_GENLIST_ITEM_HEAD) wd->head_item = it;
- else
- {
if (flags & ELM_GENLIST_ITEM_GROUP)
- wd->group_items = eina_list_append(wd->group_items, it);
+ wd->group_items = eina_list_append(wd->group_items, it);
wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it));
- }
it->rel = NULL;
}
else
if (ll) it2 = ll->data;
it->parent->items = eina_list_append(it->parent->items, it);
if (!it2) it2 = it->parent;
+ if (it2->delete_me)
+ it2 = elm_genlist_item_prev_get(it2);
wd->items =
eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
EINA_INLIST_GET(it2));
it->rel = it2;
it->rel->relcount++;
- if (it->parent->flags & ELM_GENLIST_ITEM_GROUP)
- it->group_item = parent;
+ if (it->parent->flags & ELM_GENLIST_ITEM_GROUP)
+ it->group_item = parent;
else if (it->parent->group_item)
- it->group_item = it->parent->group_item;
+ it->group_item = it->parent->group_item;
}
it->before = EINA_FALSE;
- if (flags != ELM_GENLIST_ITEM_HEAD) _item_queue(wd, it);
-
+ _item_queue(wd, it);
return it;
}
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
func_data);
- if (!wd) return NULL;
if (!it) return NULL;
if (!it->parent)
{
if (flags & ELM_GENLIST_ITEM_GROUP)
- wd->group_items = eina_list_prepend(wd->group_items, it);
+ wd->group_items = eina_list_prepend(wd->group_items, it);
wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it));
it->rel = NULL;
}
if (ll) it2 = ll->data;
it->parent->items = eina_list_prepend(it->parent->items, it);
if (!it2) it2 = it->parent;
+ if (it2->delete_me)
+ it2 = elm_genlist_item_next_get(it2);
wd->items =
- eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
- EINA_INLIST_GET(it2));
+ eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
+ EINA_INLIST_GET(it2));
it->rel = it2;
it->rel->relcount++;
}
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(before, NULL);
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
func_data);
- if (!wd) return NULL;
if (!it) return NULL;
if (it->parent)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL);
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
func_data);
- if (!wd) return NULL;
if (!it) return NULL;
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
EINA_INLIST_GET(after));
wd->clear_me = EINA_TRUE;
EINA_INLIST_FOREACH(wd->items, it)
- {
- it->delete_me = EINA_TRUE;
- }
+ {
+ it->delete_me = EINA_TRUE;
+ }
return;
}
- wd->clear_me = EINA_FALSE;
while (wd->items)
{
Elm_Genlist_Item *it = ELM_GENLIST_ITEM_FROM_INLIST(wd->items);
it->nocache = EINA_TRUE;
- it->hilighted = EINA_FALSE;
-#ifdef ANCHOR_ITEM
+ it->highlighted = EINA_FALSE;
+#ifdef ANCHOR_ITEM
if (wd->anchor_item == it)
{
wd->anchor_item = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
wd->anchor_item =
ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
}
-#endif
+#endif
wd->items = eina_inlist_remove(wd->items, wd->items);
if (it->flags & ELM_GENLIST_ITEM_GROUP)
it->wd->group_items = eina_list_remove(it->wd->group_items, it);
- if (it->flags & ELM_GENLIST_ITEM_HEAD) it->wd->head_item = NULL;
elm_widget_item_pre_notify_del(it);
- if (it->effect_item_realized) _effect_item_unrealize(it);
+ if (it->effect_item_realized) _effect_item_unrealize(it);
if (it->realized) _item_unrealize(it);
- if (it->itc->func.del)
- it->itc->func.del((void *)it->base.data, it->base.widget);
+ if (((wd->clear_me) || (!it->delete_me)) && (it->itc->func.del))
+ it->itc->func.del((void *)it->base.data, it->base.widget);
if (it->long_timer) ecore_timer_del(it->long_timer);
if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
elm_widget_item_del(it);
}
+ wd->clear_me = EINA_FALSE;
wd->anchor_item = NULL;
while (wd->blocks)
{
if (wd->item_moving_effect_timer)
{
ecore_animator_del(wd->item_moving_effect_timer);
- wd->item_moving_effect_timer = NULL;
+ wd->item_moving_effect_timer = NULL;
}
wd->show_item = NULL;
wd->pan_x = 0;
/**
* Enable or disable multi-select in the genlist
*
- * This enables (EINA_TRUE) or disableds (EINA_FALSE) multi-select in
+ * This enables (EINA_TRUE) or disables (EINA_FALSE) multi-select in
* the list. This allows more than 1 item to be selected.
*
* @param obj The genlist object
Eina_Bool done = EINA_FALSE;
if (!wd) return NULL;
EINA_INLIST_FOREACH(wd->blocks, itb)
- {
- if (itb->realized)
- {
- Eina_List *l;
- Elm_Genlist_Item *it;
+ {
+ if (itb->realized)
+ {
+ Eina_List *l;
+ Elm_Genlist_Item *it;
- done = 1;
- EINA_LIST_FOREACH(itb->items, l, it)
- {
- if (it->realized) list = eina_list_append(list, it);
- }
- }
- else
- {
- if (done) break;
- }
- }
+ done = 1;
+ EINA_LIST_FOREACH(itb->items, l, it)
+ {
+ if (it->realized) list = eina_list_append(list, it);
+ }
+ }
+ else
+ {
+ if (done) break;
+ }
+ }
return list;
}
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord ox, oy, ow, oh;
- Evas_Coord head_y = 0;
Item_Block *itb;
Evas_Coord lasty;
if (!wd) return NULL;
evas_object_geometry_get(wd->pan_smart, &ox, &oy, &ow, &oh);
lasty = oy;
-
- if (wd->head_item) head_y = wd->head_item->h;
EINA_INLIST_FOREACH(wd->blocks, itb)
- {
- Eina_List *l;
- Elm_Genlist_Item *it;
+ {
+ Eina_List *l;
+ Elm_Genlist_Item *it;
- if (!ELM_RECTS_INTERSECT(ox + itb->x - itb->wd->pan_x,
- oy + itb->y + head_y - itb->wd->pan_y ,
- itb->w, itb->h, x, y, 1, 1))
- continue;
- EINA_LIST_FOREACH(itb->items, l, it)
- {
- Evas_Coord itx, ity;
+ if (!ELM_RECTS_INTERSECT(ox + itb->x - itb->wd->pan_x,
+ oy + itb->y - itb->wd->pan_y,
+ itb->w, itb->h, x, y, 1, 1))
+ continue;
+ EINA_LIST_FOREACH(itb->items, l, it)
+ {
+ Evas_Coord itx, ity;
- itx = ox + itb->x + it->x - itb->wd->pan_x;
- ity = oy + itb->y + it->y - itb->wd->pan_y;
- if (ELM_RECTS_INTERSECT(itx, ity, it->w, it->h, x, y, 1, 1))
- {
- if (posret)
- {
- if (y <= (ity + (it->h / 4))) *posret = -1;
- else if (y >= (ity + it->h - (it->h / 4)))
- *posret = 1;
- else *posret = 0;
- }
- return it;
- }
- lasty = ity + it->h;
- }
- }
+ itx = ox + itb->x + it->x - itb->wd->pan_x;
+ ity = oy + itb->y + it->y - itb->wd->pan_y;
+ if (ELM_RECTS_INTERSECT(itx, ity, it->w, it->h, x, y, 1, 1))
+ {
+ if (posret)
+ {
+ if (y <= (ity + (it->h / 4))) *posret = -1;
+ else if (y >= (ity + it->h - (it->h / 4)))
+ *posret = 1;
+ else *posret = 0;
+ }
+ return it;
+ }
+ lasty = ity + it->h;
+ }
+ }
if (posret)
{
if (y > lasty) *posret = 1;
while (wd->selected)
_item_unselect(wd->selected->data);
}
- _item_hilight(it);
+ _item_highlight(it);
_item_select(it);
}
else
if(it->wd->effect_mode && !it->wd->alpha_bg)
it->wd->alpha_bg = _create_tray_alpha_bg(it->base.widget);
-
+
if (it->expanded)
{
it->wd->auto_scrolled = EINA_FALSE;
it->wd->show_item = NULL;
}
if ((it->group_item) && (it->wd->pan_y > (it->y + it->block->y)))
- gith = it->group_item->h;
+ gith = it->group_item->h;
elm_smart_scroller_child_region_show(it->wd->scr,
it->x + it->block->x,
it->y + it->block->y - gith,
elm_genlist_item_bring_in(Elm_Genlist_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
- Evas_Coord gith = 0;
+ Evas_Coord gith = 0;
if (it->delete_me) return;
if ((it->queued) || (!it->mincalcd))
{
it->wd->show_item = NULL;
}
if ((it->group_item) && (it->wd->pan_y > (it->y + it->block->y)))
- gith = it->group_item->h;
+ gith = it->group_item->h;
elm_smart_scroller_region_bring_in(it->wd->scr,
it->x + it->block->x,
it->y + it->block->y - gith,
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
}
-// if (it->itc->func.del)
-// it->itc->func.del((void *)it->base.data, it->base.widget);
+ if (it->itc->func.del)
+ it->itc->func.del((void *)it->base.data, it->base.widget);
return;
}
_item_del(it);
elm_genlist_item_update(Elm_Genlist_Item *it)
{
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
- if (it->flags != ELM_GENLIST_ITEM_HEAD)
- {
if (!it->block) return;
if (it->delete_me) return;
it->mincalcd = EINA_FALSE;
it->updateme = EINA_TRUE;
it->block->updateme = EINA_TRUE;
- }
if (it->wd->update_job) ecore_job_del(it->wd->update_job);
it->wd->update_job = ecore_job_add(_update_job, it->wd);
}
wd->effect_mode = emode;
// wd->point_rect = evas_object_rectangle_add(evas_object_evas_get(wd->obj));
// evas_object_resize(wd->point_rect, 10, 25);
- // evas_object_color_set(wd->point_rect, 255, 0, 0, 130);
+ // evas_object_color_set(wd->point_rect, 255, 0, 0, 130);
// evas_object_show(wd->point_rect);
// evas_object_hide(wd->point_rect);
}
}
static unsigned int
-current_time_get()
+current_time_get()
{
struct timeval timev;
if (wd->edit_mode) _effect_item_controls(it, it->scrl_x, it->old_scrl_y + y);
else
{
- evas_object_resize(it->base.view, it->w-(it->pad_left+it->pad_right), it->h);
- evas_object_move(it->base.view, it->scrl_x+it->pad_left, it->old_scrl_y + y);
+ evas_object_resize(it->base.view, it->w, it->h);
+ evas_object_move(it->base.view, it->scrl_x, it->old_scrl_y + y);
evas_object_show(it->base.view);
evas_object_raise(it->base.view);
}
- if(wd->head_item) evas_object_raise(wd->head_item->base.view);
if (it->group_item) evas_object_raise(it->group_item->base.view);
}
evas_object_lower(wd->alpha_bg);
evas_object_hide(wd->alpha_bg);
if (wd->calc_job) ecore_job_del(wd->calc_job);
- wd->calc_job = ecore_job_add(_calc_job, wd);
+ wd->calc_job = ecore_job_add(_calc_job, wd);
elm_smart_scroller_bounce_animator_disabled_set(wd->scr, EINA_FALSE);
wd->move_effect_mode = ELM_GENLIST_ITEM_MOVE_EFFECT_NONE;
static void
_elm_genlist_pinch_zoom_execute(Evas_Object *obj, Eina_Bool emode)
{
- printf("!!! NOW FIXING \n");
+ printf("!!! NOW FIXING \n");
}
*/
/**
* Set pinch zoom mode
- *
+ *
* @param obj The genlist object
- * @param emode
+ * @param emode
* (EINA_TRUE = pinch contract (zoom in), EINA_FALSE = pinch expand (zoom out)
- *
+ *
* @ingroup Genlist
*/
EAPI void
elm_genlist_pinch_zoom_mode_set(Evas_Object *obj, Eina_Bool emode)
{
- printf("!!! NOW FIXING \n");
+ printf("!!! NOW FIXING \n");
}
/**
* Get pinch zoom mode
- *
+ *
* @param obj The genlist object
* @return The pinch mode
* (EINA_TRUE = pinch contract (zoom in), EINA_FALSE = pinch expand (zoom out)
- *
+ *
* @ingroup Genlist
*/
EAPI Eina_Bool
elm_genlist_pinch_zoom_mode_get(const Evas_Object *obj)
{
- printf("!!! NOW FIXING \n");
+ printf("!!! NOW FIXING \n");
return EINA_FALSE;
}
EAPI void
elm_genlist_pinch_zoom_set(Evas_Object *obj, Eina_Bool emode)
{
- printf("!!! NOW FIXING \n");
+ printf("!!! NOW FIXING \n");
}
////////////////////////////////////////////////////////////////////////
-// EDIT MODE
+// EDIT MODE
////////////////////////////////////////////////////////////////////////
static void
{
if ((it->effect_item_realized) || (it->delete_me)) return;
char buf[1024];
- it->pad_left = it->pad_right = 0;
it->edit_obj = edje_object_add(evas_object_evas_get(it->base.widget));
edje_object_scale_set(it->edit_obj, elm_widget_scale_get(it->base.widget) *
if (it->wd->reorder_mode)
{
- if (effect_on) edje_object_signal_emit(it->edit_obj, "elm,state,reorder_enable_effect", "elm");
- else edje_object_signal_emit(it->edit_obj, "elm,state,reorder_enable", "elm");
+ if (effect_on) edje_object_signal_emit(it->edit_obj, "elm,state,reorder_enabled_effect", "elm");
+ else edje_object_signal_emit(it->edit_obj, "elm,state,reorder_enabled", "elm");
}
+ 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");
else edje_object_signal_emit(it->edit_obj, "elm,state,enabled", "elm");
+
if ((it->wd->edit_mode))
{
if (it->itc->func.icon_get)
elm_widget_sub_object_add(it->base.widget, ic);
}
}
- }
+ }
}
edje_object_part_swallow(it->edit_obj, "original_edc", it->base.view);
_effect_item_controls(it,it->scrl_x, it->scrl_y);
if (!it->effect_item_realized) return;
if (it->wd->reorder_it && it->wd->reorder_it == it) return;
- it->pad_left = it->pad_right = 0;
edje_object_signal_emit(it->edit_obj, "elm,state,reorder_disable_effect", "elm");
edje_object_signal_emit(it->edit_obj, "elm,state,sel,disable", "elm");
edje_object_message_signal_process(it->edit_obj);
{
EINA_LIST_FOREACH(itb->items, l, it)
{
- if (it->flags != ELM_GENLIST_ITEM_GROUP && it->realized)
+ if (it->flags != ELM_GENLIST_ITEM_GROUP && it->realized)
{
- it->pad_left = it->pad_right = 0;
_effect_item_unrealize(it);
}
}
if (it->itc->edit_item_style) _effect_item_realize(it, EINA_TRUE);
}
}
- }
- }
- }
+ }
+ }
+ }
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
fprintf(stderr, "================================================================\n");
}
-// TODO : add comment
+// TODO : add comment
EAPI Eina_Bool
elm_genlist_edit_item_selected_get(const Elm_Genlist_Item *it)
{
/**
* Set a given item's rename mode
*
- * This renames the item's label from genlist
+ * This renames the item's label from genlist
*
* @param it The item
- * @param emode set if emode is EINA_TRUE, unset if emode is EINA_FALSE
+ * @param renamed set if emode is EINA_TRUE, unset if emode is EINA_FALSE
*
* @ingroup Genlist
*/
EAPI void
elm_genlist_item_rename_mode_set(Elm_Genlist_Item *it, Eina_Bool renamed)
-{
- if (!it) return;
-
- Item_Block *itb;
-
- EINA_INLIST_FOREACH(it->wd->blocks, itb)
- {
- if (itb->realized)
{
- Eina_List *l;
- Elm_Genlist_Item *it;
-
- EINA_LIST_FOREACH(itb->items, l, it)
- {
- if (it->renamed)
- {
- it->renamed = EINA_FALSE;
- it->nocache = EINA_TRUE;
- it->wd->rename_it = NULL;
- elm_genlist_item_update(it);
- }
- }
- }
- }
+ if (!it) return;
if (renamed)
- {
+ {
+ _item_unrealize(it);
it->renamed = EINA_TRUE;
it->wd->rename_it = it;
it->nocache = EINA_TRUE;
- if (it->selected) _item_unselect(it);
+ if (it->selected) _item_unselect(it);
- _item_unrealize(it);
if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
}
+ else
+ {
+ if (it->renamed)
+ {
+ it->renamed = EINA_FALSE;
+ it->nocache = EINA_TRUE;
+ it->wd->rename_it = NULL;
+ _item_cache_zero(it->wd);
+ elm_genlist_item_update(it);
+ }
+ }
}
-
+
EAPI Eina_Bool
elm_genlist_item_rename_mode_get(Elm_Genlist_Item *item)
{
{
Widget_Data *wd = data;
if (!wd) return;
-
- if ((wd->expand_item) && (!wd->auto_scrolled))
+
+ if ((wd->expand_item) && (!wd->auto_scrolled))
{
Elm_Genlist_Item *it;
Eina_List *l;
Evas_Coord ox, oy, ow, oh;
evas_object_geometry_get(wd->obj, &ox, &oy, &ow, &oh);
-
+
wd->auto_scrolled = EINA_TRUE;
if (wd->expand_item->scrl_y > (oh + oy) / 2)
{
}
}
-EAPI int
-elm_genlist_item_flags_get(const Elm_Genlist_Item *item)
-{
- ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, EINA_FALSE);
- return item->flags;
-}
-
EAPI void
elm_genlist_realized_items_update(const Evas_Object *obj)
{
EINA_LIST_FOREACH(list, l, it)
elm_genlist_item_update(it);
}
-