Commit Graph

437 Commits

Author SHA1 Message Date
Davide Andreoli 16b16b7128 Gengrid: improve item_region_show code
There is no need to recalc row and col position of the item, they are already stored in the item struct.

The old implementation was calculating wrong values and also was storing this wrong values in it->x and it->y, resulting in wrong results for the elm_gengrid_item_pos_get() function.

so, at the end,  this is a @fix for the pos_get() function.

Also changed a bit the test to let the gengrid fill the window and thus testing behaviour on col/row changes.

I didn't find any regression in all the gengrid tests after this, let me know if it broke something for you.
2016-01-17 15:11:29 +01:00
Lukasz Stanislawski eac2c2e512 gengrid: add scrollto BOTTOM alignment type.
Summary:
Add new scrollto type allowing to align gengrid item to bottom of viewport.
Feature compleates and closes list of all alignment types for gengrid items.

Reviewers: seoz, cedric, SanghyeonLee

Subscribers: seoz

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-01-04 14:06:24 -08:00
Marcel Hollerbach 860baa4657 Elm config: use a name instead of elm_widget_type_get
Summary:
The use of elm_widget_type_get here is pretty harmfull, for the usecase
of inheriting a widget elm_widget_type_get is something else than
before. But the key binding should still work.

@fix T2891

Reviewers: tasn

Reviewed By: tasn

Maniphest Tasks: T2891

Differential Revision: https://phab.enlightenment.org/D3470
2015-12-21 12:57:15 +00:00
Lukasz Stanislawski 7b690b61d1 atspi: return previous name in overloaded getters
Some overloaded accessible name getters did not respect
values set by developer.

@fix
2015-12-17 11:38:43 +01:00
Umesh Tanwar 58b9f34035 gengrid: fix Logic in _item_single_select_left and _item_single_select_right.
Summary:
In _item_single_select_left/right functions if logic is corrected from && to ||.
The previous thing is like: if "there is a generation mismatch" and "item is
disable" then only get the next gengrid item. This seems logically incorrect.

The suggested logic is if "there is generation mismatch" OR "item disabled" then
go for the new item. Whether we get a generation mismatch or item disable, we
should look for next item. So there should be || logic instead of && logic.

@fix

Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>

Reviewers: Hermet, raster, singh.amitesh, SanghyeonLee, cedric

Subscribers: cedric, sachin.dev

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-07 16:39:40 -08:00
Lukasz Stanislawski d1baa35b1a atspi: always use widget's subobj as accessible children
Patch fixes issue when widgets could be orphaned in accessibility tree
due to overloaded accessible_children_get methods in widgets returning
Elm_Object_Items. Widgets like genlist, gengrid, list and toolbar returned
only items as its accessibility children so if some widget was attached
directly to those widgets (like ctxpopup/popup) it become orphaned
in accessibility tree.
2015-12-02 11:43:58 +01:00
Youngbok Shin ebbc66a25c gengrid: Prevent duplicated selected function calls when item is unselected in the function.
Summary:
If item is unselected in a selected function,
selected function will be called once more from _elm_gengrid_elm_widget_on_focus.
It is happened when elm_gengrid object has no focus and one of item is selected by mouse up event.
To fix this issue, we need to set focus to item and keep the address of selected item before calling selected function.
@fix

Test Plan:
1. Install & Run efbb (Escape From Booty Bay: https://git.enlightenment.org/games/efbb.git/)
2. Select a level in the main menu. (It is using elm_gengrid).
3. See duplicated target images.

Reviewers: cedric, SanghyeonLee

Reviewed By: SanghyeonLee

Differential Revision: https://phab.enlightenment.org/D3323
2015-11-18 19:39:13 +09:00
Lukasz Stanislawski 93d9489819 atspi: add missing SELECTED changed signals
@fix
2015-11-05 10:56:44 +01:00
SangHyeon Lee 0e353c727d Revert "gengrid : add all_contents_unset API in gengrid for reusing contents."
This reverts commit 1094fb77a0ee23cbe1e8b15783e406a8d93b7fd4.

Feature is freezed for new released version.
This patch must updated after release finished.
2015-10-12 18:23:56 +09:00
SangHyeon Lee 72cebeb662 gengrid : add all_contents_unset API in gengrid for reusing contents.
Summary:
Add elm_gengrid_item_all_contents_unset API for reusing contents in application side.
User can unset all contents or re-use their contents for increase scrolling performance.
genlist already support this API.

@feature

Test Plan: Need to add test in elementary_test.

Reviewers: raster, singh.amitesh, cedric

Subscribers: woohyun, Hermet, seoz

Differential Revision: https://phab.enlightenment.org/D3066
2015-10-12 14:42:37 +09:00
Lukasz Stanislawski 61845ef600 atspi: properly set parent.
Set proper atspi parents in cases when AT-SPI object tree structure
should be different then elementary tree (mostly in cases of elm_widget_items)

Add regression tests for those cases.
2015-10-02 16:49:15 +02:00
Jaehwan Kim 3265eb51cd focus: add the focus_direction feature about item.
When the focus is moved, it uses focus_direction instead of
focus_origin.
It can get the focus by using the geometry of previous focused object or item

@feature
2015-09-25 15:42:45 +09:00
Amitesh Singh 3a5f8759e8 gengrid: rename function _elm_gengrid_item_focus_raise to _elm_gengrid_item_focus_update
In function _elm_gengrid_item_focus_raise, we are doing more than just focus_raise.
Rename it to something more meaningful.
2015-09-23 12:46:24 +05:30
Amitesh Singh 91ce72b72a gengrid: move item focus related code to internal _elm_gengrid_item_focused() 2015-09-23 12:42:19 +05:30
Amitesh Singh b5a99fcf46 gengrid: fix duplicate edje signal (elm,state,focused) to item on focus
@fix
2015-09-23 12:22:21 +05:30
Jaehwan Kim 146d30b738 gengrid: remove EINA_UNUSED 2015-09-16 18:46:10 +09:00
Jaehwan Kim 0dedfc9248 focus: add the APIs to set the focus next about item.
Add elm_object_focus_next_item_set/get,
elm_object_item_focus_next_object_set/get and
elm_object_item_focus_next_item_set/get.

If the item and object is set at the same time,
the item is preference to object when the focus moves.

This feature is implemented about gengrid.
It will be implemented about ohter widgets.

@feature
2015-09-15 19:53:23 +09:00
Carsten Haitzler be2ae5f410 elm autofocus show - fix cases where focus is inside containers
i found that the focus doesnt auto-show when focusing things inside
scrollers and so on. i had to add more points to trigger auto show.
this fixes that

@fix
2015-09-10 18:29:24 +09:00
Jaehwan Kim 290e0a4ce5 gengrid: fix crash issue.
Sometimes the focused_item can be null.

@fix
2015-08-31 16:21:57 +09:00
Vaibhav Gupta 261b0b5328 Gengrid: Fix wrong focus movement in _item_single_select_down
Summary:
The focus movement is wrong when down key press
is done of first item of last row, intsead of
taking the focus out, it moves the focus to next
item (right).

@fix

Signed-off-by: Vaibhav Gupta <g.vaibhav1@samsung.com>

Test Plan:
1. Launch elementary_test -> Gengrid 2 sample
2. Add a few items such that there are 2 items in last row
3. Do a down key press on 1st item of last row
4. Observe focus movement

Reviewers: raster, Hermet, SanghyeonLee, singh.amitesh

Subscribers: sachin.dev

Differential Revision: https://phab.enlightenment.org/D3001
2015-08-28 12:04:49 +05:30
Amitesh Singh 3e6351541f gengrid: fix item looping in case of horizontal mode
This mistake is done in a8afaebf3109f1cb8e397e29
2015-08-28 10:34:52 +05:30
Amitesh Singh 44c8e28698 gengrid: no need to loop in case of reorder mode is enabled
There is no need to loop when reorder mode is enabled. This looks
ugly and nobody wants it. This fault was introduced in 7aaa5c8d0a4a5714b4f1bf79e

This patch also fixes following crash
   1. elementary_test -to "Gengrid 2".
   2. Enable all the options available.
   3. Do reorder of item via keys.
   4. Observe segv on reordering edge items.

@fix
2015-08-26 21:04:36 +05:30
Amitesh Singh f0f2e7dcaf gengrid: fix item focus movement in case of horizontal mode
Steps to reproduce:
1. elementary -> gengrid focus
2. change mode to horizontal
3. set focus to one of item in 2nd column.
4. Press Left direction key
issue: focus moves out of gengrid.

@fix
2015-08-26 15:36:39 +05:30
Amitesh Singh d28822560e gengrid: add curly braces to avoid ambiguous 'if' 2015-08-26 14:38:44 +05:30
Anand e69b0fb210 elm_gengrid:Added Eolian changes in gengrid reorder Api
Summary:
Modified gengrid reorder Api's(elm_gengrid_reorder_mode_start, elm_gengrid_reorder_mode_stop,
elm_gengrid_reorder_type_set) in Eolian format.

Test Plan: elementry_test->gengrid->gengrid_focus

Reviewers: seoz, raster, Hermet, JackDanielZ

Subscribers: cedric, JackDanielZ, mvsovani, singh.amitesh, sachin.dev

Differential Revision: https://phab.enlightenment.org/D2510
2015-08-14 09:40:18 +03:00
Yeshwanth Reddivari 7251a154f9 Gengrid: Set focus after item looping
Summary:
After item looping, Gengrid item was getting selected.
So, checked for item_select_on_focus_disable flag and
accordingly set focus state or selected state of Gengrid item.

@fix

Signed-off-by: Yeshwanth Reddivari <r.yeshwanth@samsung.com>

Reviewers: raster, Hermet, singh.amitesh, SanghyeonLee

Subscribers: sachin.dev

Differential Revision: https://phab.enlightenment.org/D2937
2015-08-14 11:20:30 +05:30
Jaehwan Kim 1bc01460c4 focus: item focus moves by geometry.
In the widget code, focus origin is added. It can know
the focus movement is originated by which action.
The widgets can choose the item focus moves to last focused item
or geometrically nearby item by focus origin.
In gengrid, focus moves to last focused item if focus origin is
ELM_FOCUS_REVERT. It moves to nearby item if focus origin is from
ELM_FOCUS_UP to ELM_FOCUS_LEFT.

TODO: widgets have items should add the direction feature if it
want the focus to move to nearby item.

@feature
2015-08-13 13:58:04 +09:00
Jaehwan Kim b3a86fc230 focus: add the focus region show mode
When the focus is move to the object in scroller, it is scrolled
to show the focus region as a widget.
If the focus region want to be shown as an item,
set the mode ELM_FOCUS_REGION_SHOW_ITEM.
If then, it will be scrolled as an item.
TODO: Widgets have items are added on_focus_region function.

@feature
2015-08-12 17:30:44 +09:00
Jaehwan Kim e9afa67f2b gengird: change focus move mechanism in gengrid.
This commit is related to 4d553d2bcf2157053433994ca3facb56bd670da9.
It doesn't work if item_select_on_focus_disable is 1.
So _item_focus_down is changed like _item_single_select_down.

@fix
2015-08-12 11:09:17 +09:00
Jyotiprakash Sahoo 078185b2cb gengrid: extends D2418 to horizontal mode.
Summary:
do not return yet in case of edge items if looping
is disabled. try to select/focus last item.

Signed-off-by: Jyotiprakash Sahoo <jp.sahoo@samsung.com>

@fix

Test Plan: elementary_test -> Gengrid 2

Reviewers: raster, singh.amitesh, cedric, SanghyeonLee

Reviewed By: SanghyeonLee

Differential Revision: https://phab.enlightenment.org/D2865
2015-08-11 22:10:09 +09:00
Youngbok Shin 3fb443df95 focus/list/genlist/gengrid: fix focus highlight issues on list widgets when auto focus enable is on.
Summary:
elm_list, elm_genlist widgets are handle focus highlight
relying on only elm_widget_focus_highlight_enabled_get() API.
The API is not considered about auto focus highlight feature.
So, we need to check a flag for auto focus from _elm_config.
It resolves T2555.
@fix

Test Plan: elementary_test -> List Focus or Genlist Focus

Reviewers: raster, cedric, SanghyeonLee, singh.amitesh

Reviewed By: SanghyeonLee, singh.amitesh

Maniphest Tasks: T2555

Differential Revision: https://phab.enlightenment.org/D2914
2015-08-05 12:27:11 +05:30
Hosang Kim 8bcd1906b0 elm_gengrid: fix missing variable initialization.
Summary:
- item's still_in variable is not initialized.

@fix

Reviewers: seoz, singh.amitesh, raster, SanghyeonLee

Reviewed By: SanghyeonLee

Differential Revision: https://phab.enlightenment.org/D2871
2015-07-27 13:59:29 +09:00
Hosang Kim 0b64bda298 elm_gengrid: Fix condition error.
Summary:
I missed "!" in if condition and missed it->unhighlighted_cb().

@fix

Reviewers: singh.amitesh, raster, cedric, SanghyeonLee

Reviewed By: SanghyeonLee

Differential Revision: https://phab.enlightenment.org/D2861
2015-07-24 14:40:01 +09:00
Amitesh Singh ff68a39745 gengrid: remove memset to optimize items swapping via keys.
No need to call memset(0) as struct values are getting fill eventually.
2015-07-15 23:51:26 +05:30
Daniel Zaoui 59730595e3 Eo Events: port more Evas Smart callbacks to Eo
Some Evas Smart callbacks invocations were still inside code
and should have been ported.
2015-07-07 11:24:12 +03:00
Daniel Zaoui c66013a1fc Eo events: fix wrong event invocations
Events were still created and used on high level classes when Evas
interfaces events should have been used (e.g CLICKED, SELECTED).
2015-07-05 19:14:36 +03:00
Avi Levin 7c4411630c etc_ctxpopup, elm_gengrid, elm_notify: porting evas smart callbacks to eo 2015-07-02 08:04:02 +03:00
Prince Kr Dubey 782817d6c5 elm_gengrid: fix an overlap issue of item and group item on focus.
Summary: Issue: Gengrid item comes over group item on click.

Test Plan:
Run elementary test.
Open GenGrid Group. Click on any item which slightly overlap with group item.
Item comes over group item.

Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: rajeshps, govi, poornima.srinivasan, shilpasingh

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 17:24:08 +02:00
SangHyeon Lee 3d536db3c2 elm_gengrid: fix the bug that gengrid item index(position) is updated wrong value in item_update
Summary:
elm_gengrid_item_update perform item_unrealize/item_realize/item_place itself.
But when gengrid items are added and not calculated yet,
caller want to get item's index after execute elm_gengrid_item_update,
return value is wrong because item_place update it's position in not-updated item's x and y.

to prevent this,
if item position is already updated,
do not updates position in item place.

additionally,
I fixed gengrid item prepend wrong posiiton update.
gengrid item position start from 1 not 0, so item_position_update also must be started from 1.

@fix

Test Plan:
To test this scenario,
need to fix src/bin/test_gengrid.c first.

1. add below codes in bottom of _after_bt_clicked(line 703).

```
      Elm_Object_Item *it = elm_gengrid_item_next_get(id->item);
      printf("before update efl item[%p], index [%d]\n",id->item,elm_gengrid_item_index_get(it));
      elm_gengrid_item_update(it);
      printf("after update efl item[%p], index [%d]\n",id->item,elm_gengrid_item_index_get(it));
```

2. execute elementary_test and go to gengrid2 test.

3. add 3 items and select 2nd item then add new item by insert after.

4. you can see index is changed wrong value after item_update executed.

after add fallback code in item_update,
index is returned same value even after item_update execusion.

Reviewers: raster, Hermet, seoz, jaehwan

Subscribers: anand.km, eagleeye, singh.amitesh

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 17:24:08 +02:00
Hosang Kim da81eff897 elm_list & elm_genlist & elm_gengrid: fix the behavior of using the mouse.
Summary:
Elementary widgets have different behavior of using the mouse, they need to be unified.
- swipe : without checking on hold, just checking drag state.
- longpress : after longpress, _item_unhighlight(), _item_unselect() are called.
- select : when the mouse pointer leaves item area, _item_unhighlight(), _item_unselect() are called.

First, apply this commit https://phab.enlightenment.org/D2550

Test Plan: elementary_test -> list

Reviewers: seoz, Hermet, CHAN, woohyun, kimcinoo, jaehwan, SanghyeonLee, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 17:24:08 +02:00
Hosang Kim 126fb18ca9 gengrid: add unhighlight callback
Summary:
item_unselect check it->select status, so when item highlighted but not selected,
item highlight is remaining even after unselect_cb is called.

And item_select and item_highlight are separated, but item_unselect and item_unhighlight are mixed.
so divide them, too.

This patch will solve upon problem.

Reviewers: seoz, woohyun, Hermet, CHAN, raster, SanghyeonLee, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 17:24:08 +02:00
SangHyeon Lee d700a9b86f gengrid: add item cache in gengrid for efficient realize/unrealize operation.
Summary:
gengrid realize/unrealize items each smart calculation if their posiiton is updated.
This concept will be occurred useless view object creation and deletion.
So instead of delete items in unrealize function, push item cache into cache list,
and pop item cache from cache list in realize function to reuse item view object
more efficiently.
the cache concept is already implemented in genlist widget and this patch is improved
item cache of genlist cache.
@feature

```
NOTICE: This patch is written under the D2561 Patch which add elm_gengrid_item_fields_update.
        So it must submitted after D2561.
```

Test Plan:
I've tested below three cases,
   1. tested ith this patch in elementary_test and checked all gengrid features are working properly.
   2. tested with changing CACHE_MAX to another value which is set 40 in default
       and checked all gengrid features are working properly.
   3. tested with set it->item->nocache true, and checked cache is never generated
       and checked all gengrid features are working properly.

Reviewers: raster, Hermet, seoz, jaehwan, singh.amitesh

Subscribers: eagleeye, singh.amitesh, Jaehyun

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 17:24:08 +02:00
Daniel Kolesa 3904cc7175 elm: constify Eolian methods correctly because of recent Eolian changes 2015-06-25 12:21:00 +01:00
SangHyeon Lee 3304346e37 gengrid: remove duplicated focus state recovering.
Summary:
gengrid focus state recovering in item_realize is duplicated.
remove unnecessary lines.

you can find same signal emit codes under line 1018.

Test Plan: test elemetary test gengrid focus highight show correctly after code merged.

Reviewers: raster, Hermet, seoz, jaehwan, cedric

Reviewed By: cedric

Subscribers: singh.amitesh, eagleeye

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-17 15:59:19 +02:00
Mike Blumenkrantz f085834d1f gengrid/genlist: decrement item counter before triggering item del callback
@fix
2015-05-28 11:59:51 -04:00
SangHyeon Lee 26a9e6cec2 Gengrid: fix mirroring bug in gengrid widget.
Summary:
Below bugs are exist in gengrid widget when use horizontal mode and mirrored set.

1. Gengrid item is placed wrong position when mirrored set.
   Current calulation for mirroring in _item_place only consider pan object positions.
   if widget is mirrored, item should be placed opposited position so object x position must be
   consider in mirroring calculation also.

2. Gengrid scroll(pan) minimum size is returned wrong value when mirroed set.
   As the result of 1's calculation present oposite position of items, so align also reversed when mirrored.
   but current gengrid didn't change align x so minimum size is return wrong value
   and scroller expanded wrong direction.

@fix

Test Plan:
1. run elementary_test and set mirroring On
2. run Gengrid2 in elementary_test
3. see how items are placed by push append button repeatly.
4. see scroller shows correct position and items.
5. change usr/bin/test_gengrid.c to set another align value on gengrid and test again.

Reviewers: raster, seoz, Hermet, jaehwan

Subscribers: Jaehyun, anand.km, eagleeye, singh.amitesh

Differential Revision: https://phab.enlightenment.org/D2553
2015-05-28 23:07:27 +09:00
Lukasz Stanislawski e483ffa636 gengrid: implement Atspi_Selection interface
Allow to select and deselect gengrid items by Assistive Technology
Clients through org.a11y.atspi.Selection dbus interface.
2015-05-27 08:23:51 +02:00
Vaibhav Gupta 1488595c1e Gengrid: Updated gengrid to select the last item.
Summary:
Updated gengrid to move item selection in 'vertical' mode to the last
item, when currently selected item is not in the last row. As per the
original behaviour, on moving down from such an item, it takes the
focus out of the gengrid widget. Now it is updated to go to the last
item (in last row), and then on further pressing down, focus comes
out of gengrid.

This is something similar to what happens in other UI systems like in
Ubuntu and Windows, when pressing down on (n-1)th row, the last item
in the nth row gets focused.

Signed-off-by: Vaibhav Gupta <g.vaibhav1@samsung.com>

Reviewers: Hermet, SanghyeonLee, raster

Reviewed By: raster

Subscribers: sachin.dev, singh.amitesh

Differential Revision: https://phab.enlightenment.org/D2418
2015-05-21 18:02:00 +09:00
Tom Hacohen 27b72840c8 Adjust usage of eo_constructor() according to recent changes. 2015-05-20 13:03:28 +01:00
Lukasz Stanislawski f299be8712 gengrid: fix mem leak occuring when getting name from atspi interface 2015-05-04 11:46:05 +02:00