Commit Graph

90 Commits

Author SHA1 Message Date
Amitesh Singh 7fa14e5cc6 genlist: fix multiple focus edje signal issue
We need focus edje signal when item is focused or the already
focused item realizes. its wrong to call focus signal on
_elm_genlist_item_state_update()

fixes T4969
2017-07-11 15:17:09 +09:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Amitesh Singh 0141417d5d genlist: move to next focusable/selectable item when looping
this fixes a bug in genlist when scrolling is enabled and
items at top and bottom are disabled. Focus behaviour is not normal
in case up arrow is pressed when focus is at the top enabled item
or down key is pressed when focus is at bottom enabled item.

fixes T5576
2017-06-30 12:21:20 +09:00
Mike Blumenkrantz 990a9d485d elm_list/genlist/gengrid: don't unselect items when moving the mouse out of them
this seems wrong since it's using smart object geometry to determine
event-based positioning within an edje object. considering it from a user pov,
it definitely is wrong because why would you deselect items based on mouse
movement?

ref D2622
ref da81eff897

@fix
2017-06-23 17:43:44 -04:00
Jean-Philippe Andre ed41adf791 widget: Implement mirrored from Efl.Ui.Base
Ref T5363
2017-06-14 11:02:05 +09:00
SangHyeon Lee d1a5df7055 elementary: fix recursive content group calculation in genlist
Summary:
There are several problem is left on recursize content calc.
previously genlist only calculate size of layout class,
but after recursive content group calculation patch,
layout couldn't get proper size because sizing eval is
not pre-processed.

Test Plan: elementary test working fine.

Reviewers: jpeg, cedric, raster, conr2d

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-06-12 10:13:05 -07:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
Jeeyong Um 02893c39ba Genlist: Calculate the min size of content before item realize
Summary:
Genlist item doesn't change its size when its content size is changed,
but its size is determined in realization.
Therefore, deferred calculations for content should be performed immediately
before swallowing it by genlist item.

Test Plan: make and run attached sample

Reviewers: jpeg, SanghyeonLee, cedric

Differential Revision: https://phab.enlightenment.org/D4705
2017-06-09 15:09:12 +09:00
SangHyeon Lee dc98fd4f5e elm_gen : apply Elm_Theme_Apply enum return types for theme_object_get of item view.
elm_widget_theme_object_get now return Elm_Theme_Apply enum not bools.
only ELM_THEME_APPLY_FAILED case, need to re-apply default item edje.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-06-02 10:32:07 +09:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Carsten Haitzler 706c7f9e3b genlist - fix coverity complaint about null check
we checked for null and then just used a null return later inthe loop.
this fixes that. this should fix CID 1360955
2017-04-18 17:30:50 +09:00
Godly T.Alias 5cba6a5857 Genlist: Performance optimization for genlist in non-filter cases
Summary:
When _item_filtered_get is called, block and pan re-calculations
happen, When there is no filter applied, we can skip item filtering to
avoid some unwanted calculations

Reviewers: cedric, raster, SanghyeonLee

Reviewed By: raster

Subscribers: rajeshps, Princekrdubey, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4759
2017-04-13 16:40:29 +09:00
Jean-Philippe Andre 76b5749ea0 genlist: Fix another issue with insert sorted
Fixes T5274

@fix
2017-03-20 22:25:32 +09:00
Jean-Philippe Andre 83619af10a genlist: Fix a leak
Thanks @herdsman
2017-03-14 23:07:34 +09:00
Jean-Philippe Andre fbe72f6e4b genlist: Fix some more decorate mode issues
The item, after having been unswallowed from its decorate
item, becomes unclipped and unparented. The parent was well
reset, but the clip wasn't.

Test case:
  elementary_test -to "Genlist Decorate Item Mode"

I'm sure some bugs are still lurking. Genlist is so lovely.

Fixes T1551
2017-03-14 14:04:39 +09:00
Jean-Philippe Andre 635b4ad8f3 genlist: Make sure only one item is decorated
In "Genlist Decorate Item Mode" after decorating a few items
(rotate or slide, doesn't matter), only one item or none should
be decorated. Scrolling up and down the genlist should work just
fine. This fixes massive render issues and inconsistent states
of the items in this test case.

"rotate" mode is still going nuts.

Ref T1551
2017-03-14 11:04:16 +09:00
Jean-Philippe Andre ab735ada77 genlist: Make logic more readable 2017-03-14 11:04:16 +09:00
Jean-Philippe Andre f1974b7b1c genlist: Fix invalid call to stack above/below
Test process:
  elementary_test -to "Genlist Decorate Item Mode"

Slide any item to the right, observe error logs.

Ref T1551
2017-03-14 11:04:16 +09:00
Jean-Philippe Andre 6c62ae3e6e Revert "Genlist: Calculate the min size of content before item realize"
This reverts commit 60566ca34d.

This broke the layout in "Genlist Full Widget"
2017-03-10 15:20:22 +09:00
Jeeyong Um 60566ca34d Genlist: Calculate the min size of content before item realize
Summary:
Genlist item doesn't change its size when its content size is changed,
but its size is determined in realization.
Therefore, deferred calculations for content should be performed immediately
before swallowing it by genlist item.

Test Plan: make and run attached sample

Reviewers: cedric, SanghyeonLee, jpeg

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D4705
2017-03-10 14:59:48 +09:00
Jean-Philippe Andre fc40d3d559 genlist: Fix invalid state of reused content
If an item is marked as disabled it should be re-enabled
before being put in the reusable contents cache. Otherwise
a following use of this object may result in a disabled
item being used, making the UI effectively disfunctional.

Also modify the test case to show and test this behaviour.

Add an efl_isa() to protect calls to elm_widget APIs.

Fixes T5236

@fix
2017-03-10 11:22:13 +09:00
Jiwon Kim e6a1e456cb genlist: Remove weird behavior about item_show, bring_in
Summary:
When if item_show / bring_in is proceeded as 'deferred_show'
sequence, Scrollto_Type does not be checked perfectly.
As a result,
ELM_GENLIST_ITEM_SCROLLTO_NONE and any other integer values
are worked such as ELM_GENLIST_ITEM_SCROLLTO_BRING_IN.

As doxygen of Elm_Genlist_Item_Scrollto_Type,
ELM_GENLIST_ITEM_SCROLLTO_NONE and other incorrect number
should not work.

Fixes T4854

@fix

Reviewers: SanghyeonLee, woohyun, jpeg

Reviewed By: jpeg

Subscribers: id213sin, conr2d, cedric

Maniphest Tasks: T4854

Differential Revision: https://phab.enlightenment.org/D4684
2017-03-02 16:43:47 +09:00
Jean-Philippe Andre 726994d175 genlist: Final fix for odd/even styles issue
The key was to emit & process the signal to the edje objects
(item views) at the same time as we move them, ie. from the
loop in _item_block_position().

Also the proper counting must be used at all times. Hidden
items should not be counted.

Tree effect may still have issues but otherwise there is no
more blinking, double odd or even rows, etc... It all looks
good (as long as there is no tree effect!).

Fixes T3086

@fix
2017-02-27 16:26:41 +09:00
Jean-Philippe Andre 3574eb8c07 genlist: Fix fileselector crazy behaviour
When using the fileselector in tree view mode (ie. expandable),
expanding any folder with a lot of files in it would cause the
genlist view to jump somewhere to the bottom. This is because
the mechanism preventing the view from moving was assuming that
all "prepend" operations meant prepending before the selected
item. This is not the case in case of expansion like in the
fileselector.

@fix
2017-02-27 16:26:41 +09:00
Jean-Philippe Andre 380759a89e genlist: Fix rare jump in prepend insert
If an item is selected, and another item is insert before
the selected item, then we try to lock the genlist view (pan)
around the selected item (if it's visible). Unfortunately,
every 16 inserts cause a jump by one line in the scroller.
That's because the scroll math assumes the block position is
known, but since it's a new block it wasn't known.

This patch fixes this issue by precalculating the block position.

Test scenario:
 elementary_test -to "Genlist Tree, Insert Relative"

Select an item, clikck 50 times on "+ before".
The view should not jump.

This does not fix fileselector's craziness.

@fix
2017-02-27 16:26:32 +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 519b782ff2 Revert "elm_genlist: when appending items to the parent, prepend to the parent"
This reverts commit 43d82e567a.

I don't understand this commit. It broke the logical order of
items, as the internal list wouldn't match the order on screen.
Other places in the code didn't seem to make this assumption
that parents come after their children. And for sure my recent
fixes require the parent to come before.

This commit was one of the many reasons why odd/even styles
look often wrong.

See T3086
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 6245639b9c genlist: Simplify code (remove one argument)
Parameter "qadd" is always true when calling _item_process_post(),
so simplify the code by removing it.
2017-02-22 17:05:34 +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 aa5414f95d genlist: Fix insert after with a tree
This fixes a case where inserting item "C" after item "B" in this
tree would go wrong:

A
B
- 1
- 2

Before this patch, 1 and 2 lose their parent:

A
B
C
- 1
- 2

After this patch, 1 and 2 retain their parent:

A
B
- 1
- 2
C

Insert before worked by luck, no need to fix it.
Note that this patch may require the next one to actually
work (ensuring expanded state flag).

NOTE: This is a behaviour break!
2017-02-22 17:05:08 +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
Amitesh Singh b66dd0635f genlist: remove uncessary _item_cache_zero call
_item_cache_zero() is already getting called in _mirrored_set

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-02-15 16:00:15 +05:30
Jean-Philippe Andre a568d26f72 evas & elm: Fix invalid uses of efl_data_ref(obj, NULL)
The data class should be specified for debug purposes.
Also, this fixes invalid uses inside the smart object
implementation where it assumed that the smart data was part
of the eo data. It may not (legacy objects).
2017-02-15 15:35:38 +09:00
Minkyu Kang 669d95252a elm_genlist: do not check scroll if show_item is NULL
Summary:
If show_item is NULL then does not need to check scroll.
But, sometimes show_item is NULL but check_scroll is true.
It was wrong and can makes a crash.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

Reviewers: cedric, Hermet, SanghyeonLee, raster

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-07 15:14:54 -08:00
Amitesh Singh 7a5e64ef90 genlist: fix mem leak on focus next
This patch fixes an eina list mem leak on each
focus next(tab/alt-tab) traversal.

@fix
2017-01-24 22:50:24 +05:30
SangHyeon Lee 7b6cd2862d genlist : fixing wrong item realize bug when block is changed
Summary :
If current realized item is changed to another block which
was unrealized, item still stay in realized states because
new block is unrealized.
so when adding item to new block, adding realized state check
to change block realized state correctly.

Test Plan :
The issue is happen in eflete edc group list view.
when you expand and contract the tree view, if child is
bigger then block size, items under the current tree still
floating on the child items.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-01-04 14:32:14 +09:00
SangHyeon Lee 3d13678450 genlist : initialize disabled content for reusing
initialize disabled content for reusing again.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-01-04 14:26:22 +09:00
Jee-Yong Um 6d0a2398ad Elm.Widget: rename "event.*" methods to solve name conflict
Summary:
Elm.Widget.event_callback_add conflicts with Efl.Object.event_callback_add.
To solve this problem, "widget_" prefix is added to methods starting with
"event".

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4521
2017-01-03 10:59:49 +09:00
Hermet Park 436e07277e elementary genlist: code refactoring.
removed duplicated logic and add a descriptive comment.
2016-12-07 14:17:33 +09:00
jinwoo.shin 825af0c89c genlist : fix cannot scroll to item after call elm_genlist_item_update
Summary: Fix cannot scroll to item after call elm_genlist_item_update

Test Plan: https://phab.enlightenment.org/T4974

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: SanghyeonLee, minkyu, cedric, jpeg

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D4460
2016-12-07 13:57:56 +09:00
Shinwoo Kim e648f1e85e [elementary][atspi] change accessible description to char* from const char*
Summary:
The accessible name is char*, this could confuse API user.
If we provide user callback to get description, an user would return allocated string.
The usage of elm_interface_atspi_description_get/set should be same with elm_interface_atspi_name_get/set

Reviewers: lukasz.stanislawski, cedric, raster

Reviewed By: raster

Subscribers: stanluk, jpeg

Differential Revision: https://phab.enlightenment.org/D4378
2016-11-10 11:11:48 +09:00
Daniel Zaoui 773c56c645 Genlist: remove callback from correct object
Edje callback was removed from genlist instead of its Edje object.
2016-11-09 07:42:57 +02:00
Jean-Philippe Andre 8a9f0bd603 evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
 - intercept
 - smart resize (do stuff), super, super, super
 - evas object resize

The new code is more like:
 - intercept
 - super, super, super, evas object resize
 - do stuff

But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 11b7cf6b72 evas/elm: Remove function group_move
This is an override of efl_gfx_position_set.
As for the other patches, I hope I didn't break anything.

A problem likely to happen is that the super call was inserted
too early or too late in the call flow. For instance:

  _myclass_position_set(obj, x, y) {
    position_set(super(obj), x, y);
    position_get(obj, &prevx, &prevy);
    do_something_with_delta_xy();
  }

The above code flow is obvisouly wrong, but may have crept in this
patch (such a bug sneaked in inside smart object, breaking
everything at first).
2016-10-12 11:25:56 +09:00
Minkyu Kang ec8487a8a4 elm_genlist: apply the item_select_on_focus_disable feature on key_action_move
Summary:
Previously, focused item was always selected on first and last key action.
If item_select_on_focus_disable is true, item should not be selected.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>

Test Plan: elementary_test -to genlist

Reviewers: cedric, SanghyeonLee, Hermet

Reviewed By: Hermet

Subscribers: sju27, seoz, jpeg

Differential Revision: https://phab.enlightenment.org/D4272
2016-09-01 20:20:53 +09:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Jean-Philippe Andre 3b175fd7e9 elm: Fix some ERR messages following previous patch
This simply avoids calling functions on NULL objects, since
the previous patch would ERR out rather than silently ignore
the problem.

I just add explicit NULL checks before calling the functions,
so it's clear the object could be NULL (in the widget).
2016-08-26 17:15:05 +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