For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.
But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.
Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).
@feature
fix decorate mode crash issue reported by Jack Daniel in T6000
which is occured by dangling pointer in item deletion on decorate mode.
Signed-off-by: SangHyeon Jade Lee <dltkdgus1764@gmail.com>
It's not beta. It's about to die.
Also, move #define ELM_WIDGET_BETA to the common header file, as it is
consequently required by ALL widgets. :(
Ping @bu5hm4n :)
Ref T5363
I was told that the scrollable interface is being redesigned for EO.
This API definitely does not belong to the base Widget class, as it's
quite specific to item-based scrollable widgets, such as lists and
grids. Since Elm.Interface_Scrollable is itself being revamped, it is a
good place to move that EO API for now.
Ref T5363
This is also another protected and beta API. Meant to be overridden by
subclasses, but belongs to a still unstable API.
The difference between the internal legacy and the EO API is really bad.
Same as with activate (previous commit).
Ref T5363
Also prefix with widget.
I want to rename this as child rather than sub. It's inconsistent with
the other parent/child hierarchies. Anyway the various hierarchies are
confusing, so let's keep this name :)
Ref T5363
This factorizes the code and makes most widgets handle key down events
in the same way:
- check that the object is not disabled, event is not on hold
- figure out the key binding based on the class name
- mark event as on hold
The class name is usually MY_CLASS_NAME but in some cases it was
MY_CLASS_NAME_LEGACY which may be different from the EO class name (eg.
elm_win vs. Efl.Ui.Win). In that case the key bindings are broken.
This breaks key bindings for the following widgets:
- Win (focus)
- Image ("clicked")
- Video (move, play)
This fixes key bindings for the following widgets:
- Nstate
Some widgets remain broken:
- Photocam / Efl.Ui.Image.Zoomable
A patch will be applied to restore the key bindings for the above
breaks.
This is an internal function that should probably become an overridable
protected method, as it's required for proper event handling in widgets.
Next step: use eo_event_info in the widgets implementations. Then remove
legacy event struct.
Ref T5363
Some names have not been changed, hopefully making a distinction
between legacy APIs and internal code (elm_layout_blah) and valid EO
usages.
This means many internal functions are still elm_layout_ as their
sole purpose is to support the legacy API.
Ref T5315
elm_layout_sizing_eval() marks an object as requiring recalc.
Unfortunately, it's been massively abused by various widgets into
actually doing the calc, or the min calc. So we end up with one API
that has 3 different definitions depending on the widget type:
1. Mark as requiring recalc (correct, respects doc, elm_layout)
2. Calculate min size and other size hints
3. Actually do some geometry modification
I believe we need to clarify these 3 requirements into 3 very clear
and specific APIs in elementary. Right now we have similar functions
in evas for 1 (evas_object_smart_changed) and 3 (smart_calculate).
But their exact definition also isn't necessarily what we want for
elementary.
Another clear problem is that layout_eval does not do any calculation
(in theory), so the "eval" word is a bit of a stretch here.
Once we're sure about the exact API we want, we can add this back to
EO and make it work across our EO widgets. For now let's just keep
the legacy API, and its EO overrides, as is.
Ref T5315
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
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
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
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>
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
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>
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
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
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
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
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
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
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
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
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
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
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