forked from enlightenment/efl
elm/genlist: remove conditional in _calc_job for verifying show_item code
I think at some point in the past this was necessary to avoid weird show mechanics, but now things have changed and it's best to always attempt to scroll and let the scroller internals figure things out this resolves the case where attempting to scroll to an item during a genlist's calc (ie. the item was not present in a full layout calc) would fail to scroll to the item if the scroll method was TOP and the item was too close to the bottom of the list fix T6368 @fix Differential Revision: https://phab.enlightenment.org/D6466
This commit is contained in:
parent
0b27fd8dfd
commit
1a75537ab8
|
@ -764,11 +764,10 @@ _calc_job(void *data)
|
||||||
{
|
{
|
||||||
int in = 0;
|
int in = 0;
|
||||||
Item_Block *itb, *chb = NULL;
|
Item_Block *itb, *chb = NULL;
|
||||||
Evas_Coord pan_w = 0, pan_h = 0;
|
|
||||||
ELM_GENLIST_DATA_GET(data, sd);
|
ELM_GENLIST_DATA_GET(data, sd);
|
||||||
Eina_Bool minw_change = EINA_FALSE;
|
Eina_Bool minw_change = EINA_FALSE;
|
||||||
Eina_Bool did_must_recalc = EINA_FALSE;
|
Eina_Bool did_must_recalc = EINA_FALSE;
|
||||||
Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0, vw = 0;
|
Evas_Coord minw = -1, minh = 0, y = 0, ow = 0, vw = 0;
|
||||||
|
|
||||||
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h);
|
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h);
|
||||||
if (sd->mode == ELM_LIST_COMPRESS)
|
if (sd->mode == ELM_LIST_COMPRESS)
|
||||||
|
@ -880,34 +879,11 @@ _calc_job(void *data)
|
||||||
if (!sd->show_item) sd->check_scroll = EINA_FALSE;
|
if (!sd->show_item) sd->check_scroll = EINA_FALSE;
|
||||||
if (sd->check_scroll)
|
if (sd->check_scroll)
|
||||||
{
|
{
|
||||||
elm_obj_pan_content_size_get(sd->pan_obj, &pan_w, &pan_h);
|
|
||||||
if (EINA_INLIST_GET(sd->show_item) == sd->items->last)
|
if (EINA_INLIST_GET(sd->show_item) == sd->items->last)
|
||||||
sd->scroll_to_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
sd->scroll_to_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
|
||||||
|
|
||||||
switch (sd->scroll_to_type)
|
|
||||||
{
|
|
||||||
case ELM_GENLIST_ITEM_SCROLLTO_TOP:
|
|
||||||
dy = sd->h;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
|
|
||||||
dy = sd->h / 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ELM_GENLIST_ITEM_SCROLLTO_IN:
|
|
||||||
default:
|
|
||||||
dy = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if ((sd->show_item) && (sd->show_item->item->block))
|
if ((sd->show_item) && (sd->show_item->item->block))
|
||||||
{
|
_item_scroll(sd);
|
||||||
if ((pan_w > (sd->show_item->x + sd->show_item->item->block->x))
|
|
||||||
&& (pan_h > (sd->show_item->y + sd->show_item->item->block->y
|
|
||||||
+ dy)))
|
|
||||||
{
|
|
||||||
_item_scroll(sd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->calc_job = NULL;
|
sd->calc_job = NULL;
|
||||||
|
|
Loading…
Reference in New Issue