Commit Graph

19 Commits

Author SHA1 Message Date
Mike Blumenkrantz 0d845057cc elm/genlist: hide cached item contents and mark content unfocusable during calc
cached item contents should already be hidden by the edje clipper, so this simply
changes their visible state to break them out of the focus calcs

contents must also be explicitly marked as unfocusable during calc-only realize
operations in order to avoid triggering a full focus recalc which will error due
to missing focus adapter in the item block

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10543
2019-10-29 16:09:37 +01:00
Mike Blumenkrantz 23851808bb elm/genlist: defer recalc when applying a name filter
this may be called successively during the same mainloop iteration,
so it's important to defer this as much as possible

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10524
2019-10-29 16:09:22 +01:00
Mike Blumenkrantz 712266fb9a elm/genlist: remove calc jobs
now that we have a sane and consistent sizing calc mechanism, we no longer
need to be randomly creating jobs to do additional side calcs in addition
to our other multiple bespoke calculation methods

instead, we can now call the calc function directly during the group calc
to perform all the calcs at once and avoid the overhead of constantly triggering
calc jobs

a possible future improvement here could be to remove the _calc_job() call in
the internal pan object's group_calculate, as this is likely a duplicated op
but it will require additional testing to verify

unit test performance (e.g., tree) increases roughly 50-80% after this patch

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10523
2019-10-29 16:09:18 +01:00
Marcel Hollerbach 0e462d5f5a genlist: rework the focus model for performance
Summary:
the focus model before was more meant for simplicity and not for
performance, this now is more made for performance.

The performance boost is achived by not using composition anymore,
but rather register realized items by hand. This keeps the amount
of items bound to the size of the viewport.

Additionally item realization that is followed by unrealization
immediately is not resulting in focus calls.

This solves the performance issue from T6580 in regards of focus.

perf results after this:
http://www.enlightenment.org/ss/e-5b61b50657f3c3.82619729.png

Reviewers: ManMower, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6720
2018-08-02 09:42:14 -04:00
Hermet Park df4e54f4aa elementary genlist: optimize data. 2018-05-30 13:46:12 +09:00
Hermet Park 6e74ab5ac6 elementary: packing data properly. 2018-05-30 13:37:35 +09:00
Davide Andreoli 69cf5754b5 Revert "genlist: fix "insane" order [BUG COMPATIBILITY]"
This reverts commit fd82c2521e.

This was based on a wrong assumption, see T5938 fro details
2018-04-28 10:21:57 +02:00
Marcel Hollerbach 02a062ba67 elm_genlist: support immidiate focus once the item is realized
this supports the case of item.focus = true before the item is realized.
2018-03-15 15:39:12 +01:00
Jean-Philippe Andre fd82c2521e genlist: fix "insane" order [BUG COMPATIBILITY]
This patch implements bug compatibility.

genlist internally uses both a tree structure with Eina_List and a flat
Eina_Inlist to track its items. ALL of the items are in the inlist while
subitems appear in their parent's list. As a consequence both lists must
be kept in sync pretty tightly. Obviously this is not done at all and
has led to countless bugs, as soon as tree or groups are used:
 - Invalid order of items (visually)
 - Invalid order of items with sorted_insert
 - Glitches in the matrix
 - Crashes with sorted_insert
 - Odd/even styles not properly set
 - Promote/demote functions broken by design
 - Developers send to psychiatric hospitals
 - Etc...

Legacy genlist (1.19 and before) used an inlist order that basically
didn't make sense, as it didn't follow the logical order of elements (as
they appear visually). Unfortunately this has "worked" (really, that's a
huge stretch to use this word here) for a long time this way. As a
consequence, some applications (*cough* empc *cough*) have relied on
this order to implement "next album" or "previous album" where the
album title is a group node.

By changing the order of items in the inlist, this has broken the
assumptions made above, and ends up in cases that return NULL, leading
to SEGV. Sure, the app should have checked NULL, but that's not really
the point here. The behavior has been changed.

This patch implements "fixes" for the following functions:
 - elm_genlist_first_item_get(): Don't return a parent
 - elm_genlist_last_item_get(): Return a parent
 - elm_genlist_item_next_get(): return a parent upon reaching the last child
 - elm_genlist_item_prev_get(): return a child when a parent is passed

Important notes:
 - This does not cover 100% behavior compatibility here. The only way to
   have it would be to simply revert the entire genlist code to its
   original version and never touch it again, ever.
 - An explicit API is required for an application to specify which API
   level it targets, so that we can cherry-pick which bug compatibility
   features we want to enable. We are already doing this for EDC,
   unfortunately.

@fix

fix T5938

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-13 15:15:01 -07:00
Shinwoo Kim 9f2e1d050f elm: Use ERR instead of CRI if *DATA_GET* returns NULL 2018-02-01 12:16:28 +09:00
Marcel Hollerbach b364293b0c genlist: implement item focus
this implements item-content focus for genlist. feel free to notify me
if there are any crashes or something simular.

ref T6181
2017-11-12 12:04:11 +01:00
Godly T.Alias 0496b7988a Genlist Item Pin Feature
Summary:
**@feature** T6241

This feature enables genlist to pin an item to viewport which will
be available always for user to view/select.

**Use Case**:
In a big list of music, most times when user finds a song which they
like, before playing that they may want to go through the entire list
to check whether there is some other good songs, but
after seeing the entire list user have to again scroll back to the
position of item which they liked to play it then.
In this case item pinning can be used, so that the item
which they want to keep for future selection can be pinned
and then it will remain in viewport, finally when user want to do
operation on item, it will be readily available in viewport.

Signed-off-by: Godly T.Alias <godlytalias@yahoo.co.in>

Test Plan: Elementary Test -> Genlist -> Double click on items to enable/disable pinning

Reviewers: raster, cedric, prince.dubey, SanghyeonLee

Subscribers: rajeshps, jpeg, shilpasingh

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5340
2017-11-01 16:11:30 +09:00
Jean-Philippe Andre bb38083287 genlist: (Mostly) fix item index odd/even styles
This fixes the internal item order index.

Note that groups don't reset the odd/even styles. The
original code wasn't very clear on the intent (setting
to 0 in one case, not increasing the counter in another,
but that was not consistent all over the place). I believe
resetting the odd/even styles at a group boundary would
look great, but this might be for another patch :)

This amends part of another commit, but keeps its feature:
 b40a6eb85bf44a genlist: implement list position signals.

See T3086

PS: I've discovered more odd/even issues with the
    fileselector in particular. Still working on it...

@fix
2017-02-27 09:26:41 +09:00
Jean-Philippe Andre 254ff7926b genlist: Remove macro GL_IT()
It was used to hide "it->item"... but was used less than it->item
itself. Explicit code here is not longer, and just as readable.
This macro I think was harmful to readability.

Simple sed, no real change at all.
2017-02-27 09:26:41 +09:00
Jean-Philippe Andre 3f41cdf59b genlist: Fix more tree issues (expanded state)
This fixes a lot of cases where a genlist node (of any type)
with children may have appeared in the invalid expanded or
contracted state.

Before this patch, the test case "Genlist tree, Relative insert"
looked like below (all items are programmatically added):

> A
  > 1
  > 2
> B
  > 3
  > 4

The problem above is that A and B have visible children but
still believe they are in contracted state. This patch ensures
that A and B will be marked as expanded, but will do so without
firing an "expanded" signal and definitely without the
"expand,request" signal.

After this patch, the test case will look like this:

v A
  > 1
  > 2
v B
  > 3
  > 4

Which is more correct. Note that this test case does not handle
any expand/contract signal.

NOTE: This is a behaviour break!
2017-02-22 17:05:34 +09:00
Jean-Philippe Andre fe6bdf30cd genlist: Fix sorted_insert with tree
This fixes the test case "Genlist Tree, Insert Sorted".
This is a pretty ugly patch... but the genlist code is already
pretty ugly, as it keeps a flat inlist of items (sd->items)
as well as a tree structure in parallel.

Before this patch, the following configuration led to issues:

 1
 3
 - A
 - B

Adding item "2" led to a crash. Adding item 4 led to this:

 1
 3
 4
 - A
 - B

Items A and B lost their parent "3". Subsequent sorted inserts
would lead to insane bahaviour, where for instance "8" would
appear before "3".

This patch fixes all sorted inserts, at the cost of performance
(an optimized code path is avoided). Subsequent patches will
increase the robustness of the tree structure.

NOTE: This is a behaviour break!

Fixes T4850
2017-02-22 14:46:28 +09:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
SangHyeon Lee 782f28e9a1 genlist : fix content cache issue by content_get
Summary:
genlist content_get sometimes work weird after reusable_content_get pushed.
cached content is shown even content_get function is not exist or
return NULL.
now cache check item_class instead of item style string.

Test Plan: check genlist cache in elementary_test

Reviewers: Hermet, cedric, raster

Subscribers: Jaehyun_Cho, jpeg

Differential Revision: https://phab.enlightenment.org/D3921

Conflicts:
	src/lib/elementary/elm_genlist.c
2016-05-12 07:12:18 +09:00
Cedric BAIL c2a1c49ab2 elementary: move all legacy files to their expected new location. 2016-03-23 13:24:41 -07:00