summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-06-27 16:53:55 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-02 13:29:35 +0200
commit1a75537ab8cb56f205632290a89fe2d89f4646d4 (patch)
treefdaccc5a1be14a34703d37121d468a0150aea6bf
parent0b27fd8dfddd5c305d6d186dda8cef0dc6b8c172 (diff)
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
-rw-r--r--src/lib/elementary/elm_genlist.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index d9525d9449..ced92b59f2 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -764,11 +764,10 @@ _calc_job(void *data)
764{ 764{
765 int in = 0; 765 int in = 0;
766 Item_Block *itb, *chb = NULL; 766 Item_Block *itb, *chb = NULL;
767 Evas_Coord pan_w = 0, pan_h = 0;
768 ELM_GENLIST_DATA_GET(data, sd); 767 ELM_GENLIST_DATA_GET(data, sd);
769 Eina_Bool minw_change = EINA_FALSE; 768 Eina_Bool minw_change = EINA_FALSE;
770 Eina_Bool did_must_recalc = EINA_FALSE; 769 Eina_Bool did_must_recalc = EINA_FALSE;
771 Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0, vw = 0; 770 Evas_Coord minw = -1, minh = 0, y = 0, ow = 0, vw = 0;
772 771
773 evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h); 772 evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h);
774 if (sd->mode == ELM_LIST_COMPRESS) 773 if (sd->mode == ELM_LIST_COMPRESS)
@@ -880,34 +879,11 @@ _calc_job(void *data)
880 if (!sd->show_item) sd->check_scroll = EINA_FALSE; 879 if (!sd->show_item) sd->check_scroll = EINA_FALSE;
881 if (sd->check_scroll) 880 if (sd->check_scroll)
882 { 881 {
883 elm_obj_pan_content_size_get(sd->pan_obj, &pan_w, &pan_h);
884 if (EINA_INLIST_GET(sd->show_item) == sd->items->last) 882 if (EINA_INLIST_GET(sd->show_item) == sd->items->last)
885 sd->scroll_to_type = ELM_GENLIST_ITEM_SCROLLTO_IN; 883 sd->scroll_to_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
886 884
887 switch (sd->scroll_to_type)
888 {
889 case ELM_GENLIST_ITEM_SCROLLTO_TOP:
890 dy = sd->h;
891 break;
892
893 case ELM_GENLIST_ITEM_SCROLLTO_MIDDLE:
894 dy = sd->h / 2;
895 break;
896
897 case ELM_GENLIST_ITEM_SCROLLTO_IN:
898 default:
899 dy = 0;
900 break;
901 }
902 if ((sd->show_item) && (sd->show_item->item->block)) 885 if ((sd->show_item) && (sd->show_item->item->block))
903 { 886 _item_scroll(sd);
904 if ((pan_w > (sd->show_item->x + sd->show_item->item->block->x))
905 && (pan_h > (sd->show_item->y + sd->show_item->item->block->y
906 + dy)))
907 {
908 _item_scroll(sd);
909 }
910 }
911 } 887 }
912 888
913 sd->calc_job = NULL; 889 sd->calc_job = NULL;