Commit Graph

426 Commits

Author SHA1 Message Date
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
Jaeun Choi 50127bc4df elm: add safety check
when insert a new item before/after an item, the relative item should not be NULL.
this patch fixes naviframe, gengrid, genlist, list, and toolbar.

@fix
2015-04-21 14:30:41 +09:00
Jaeun Choi e517f5e660 elm_gengrid: mark cursor_engine_only in data and update state when realized
@fix
2015-04-14 20:10:54 +09:00
Lukasz Stanislawski e0540ab2ee gengrid: remove debug 2015-04-06 10:24:59 +02:00
Lukasz Stanislawski da78012f8f atspi: fix elm_gengrid_item accessible states 2015-04-06 10:24:59 +02:00
Lukasz Stanislawski 18bd62002b atspi: remove elm_interface_atspi_widget implementation.
elm_interface_atspi_widget object was previously used to implement
atspi features on top of elm_widget object. However such inheritance
obfuscates a design, so atspi features implementation was moved directly
into elm_widget code.
2015-04-06 10:24:58 +02:00
Lukasz Stanislawski 84a774f24e atspi: change object hierachy for elm_gengrid. 2015-04-06 10:24:57 +02:00
Jaehwan Kim 29385e75ff Gengrid: Modified to handle the focus highlight on unrealized items
This commit is related to 260cdd6150d567fcee8d1afaf690e4b90cd16a2b.

When unrealized item is focused, edje object is not exist,
so genlist cannot read the focus highlight information from edje object.
Therefore, when the item is realized, check the item is focused or not and
need to update focus highlight.
2015-03-30 16:00:01 +09:00
SangHyeon Lee 411c30b408 Genlist/Gengrid : Modified to handle the focus highlight on unrealized items
Summary:
When unrealized item is focused, edje object is not exist,
         so genlist cannot read the focus highlight information from edje object.
         Therefore, when the item is realized, check the item is focused or not and
         need to update focus highlight.

@fix

Test Plan: change edc for supporting focus highlight in edc, and set focus on unrealized items.

Reviewers: raster, seoz, jaehwan

Differential Revision: https://phab.enlightenment.org/D2128
2015-03-11 20:35:53 +09:00
Jaeun Choi 8b85672bdd gengrid/genlist/list: focus first item if first_item_focus_on_first_focus_in is on
whether focus highlight is enabled or not

@fix
2015-02-27 18:17:37 +09:00
Tom Hacohen e2dcfa64ae Fix code to conform to recent Eo changes. 2015-02-23 17:16:21 +00:00
SangHyeon Lee 594fe0c8a1 genlist/gengrid : Add upadating 'focus' state in item realized function.
Summary:
When an item is realized, select/disable/expand signal emission to the view object of an item was handled correctly,but there are no updating code for focus state.

@fix

Test Plan: tested by editing genlist/genlist item edc to react on elm,state,focused and move scroll signals to unrealized/realized item again.

Reviewers: raster, seoz

Reviewed By: seoz

Subscribers: eunue

Differential Revision: https://phab.enlightenment.org/D2024
2015-02-23 17:57:01 +09:00