Commit Graph

314 Commits

Author SHA1 Message Date
Daniel Juyung Seo 4f8614e866 Revert "remove all scrolling changes for focused items."
This reverts commit 377179bdaf84aa1a86621cdfa64ed43613ab9d45.

The main claim of https://phab.enlightenment.org/T1205 was fixed in
the previous commit 30cada369. This code will be modifed again in the
next commit due to the api change during development life cycle.

Note: do not blindly revert this commit if you have any problem with
widget item focus. This commit is not related to any fundamental cause
of the issues. If you have a problem, please contact me first.

seojuyung2@gmail.com or SeoZ on IRC.

Thanks.
2014-05-11 22:42:15 +09:00
Daniel Juyung Seo dfead75366 gengrid/genlist/list/toolbar: Do not set the focus to the item on widget's first focus.
This was introduced during 1.10 development phase but this changed the
default focus behavior and got a lot of complaints. (especially from
discomfitor)

So I would like to comment this out now and make it optional on 1.11
by keeping the default behavior.
2014-05-11 21:21:51 +09:00
Daniel Juyung Seo 5407141ac6 list: added comments about an unused function.
Fixing this issue is not trivial and will bring another issues like crashing.
So it is better to fix this in a development phase by refactoring list.

To fix this issue, the following are needed:
1. it->walking concept should be adopted instead of using just sd->walking.
   sd->walking was introduced in beb418d6
2. elm_widget_item_del() should be called instead of the combination of
   _elm_list_item_free() + elm_widget_item_free()
   This was introduced in f343011d
2014-05-10 23:44:28 +09:00
Daniel Juyung Seo 254798b47e list: initialize some internal variables on item free not item del pre.
This fixes variable initialize problems related to focus. This can be
reproduced when you enable focus highlight/animation and reuse
elm_list by clearing it.

This problem occurred because list item del pre is never been called.
This bug will be addressed in a next commit.
2014-05-10 23:44:28 +09:00
zmike fe4fae4954 Revert "Revert "focus: Removed unused parameter from an internal focus function.""
This reverts commit b8549f3e83a8592145a50085182583adead2c74e.

this build system is bad and whoever did the eo integration should not feel pleased with themselves.
2014-05-07 01:13:19 -04:00
zmike 54eabd94e2 Revert "focus: Removed unused parameter from an internal focus function."
This reverts commit 5832b692aa5f68a2924bd7886390d489eb13aefb.

broke build
2014-05-07 01:08:04 -04:00
zmike be636e58be remove all scrolling changes for focused items.
this.is.BROOOOOOOOOOOOOOOKEEEEEEEEEEEEEEEEEEENNNNNNNNNNNNNNNNNNNNNNNNNNNNN.

SERIOUSLY.

you cannot go scrolling all over the place in every widget that has a scroller just because the widget gets focus. what user wants that? no user anywhere, under any circumstances, ever, in all of history.

if you dare to put this back in, I will continue to remove it for the rest of eternity until it never, ever scrolls in any unwanted case. the focused item doesn't have to always be in the viewport, and should never be moved into the viewport [[[[[[[ except to maintain an already-existing position inside the viewport ]]]]]]]

too much of my time wasted on this stupid "feature" which should have been MUCH more thoroughly tested and reviewed before it was merged.

T1205 STILL NOT FIXED
2014-05-07 01:06:30 -04:00
Daniel Juyung Seo d0380e3342 focus: Removed unused parameter from an internal focus function.
is_next parameter is not used for
elm_widget_focus_highlight_geometry_get() function.
But this parameter was not cleaned up in the commit 5320cca.
2014-05-07 00:05:07 +09:00
Amitesh Singh 8e0ffb8332 config: Added two APIs to enable/disable focus auto scroll bring in feature.
Summary:
 Summary:
    - APIs
      - elm_config_focus_auto_scroll_bring_in_enabled_set
      - elm_config_focus_auto_scroll_bring_in_enabled_get
    - list/genlist/toolbar/gengrid: Using this feature for scrolling for focus movement.
    - Added test case in "List Focus", "Genlist Focus", "Toolbar Focus" and "Gengrid Focus"

    @feature

Test Plan: elementary_test->"List Focus", "Genlist Focus", "Toolbar Focus" & "Gengrid Focus".

Reviewers: raster, seoz

CC: seoz

Differential Revision: https://phab.enlightenment.org/D799
2014-04-27 04:15:26 +09:00
Daniel Juyung Seo b173ed7c85 genlist/gengrid/list: Fix first on_focus call correctly by checking focus highlight.
First on_focus call should consider focus highlight enable status and
do the different job according to that.

This can be tested in "genlist 7" and "genlist focus" examples in
elementary_test.
2014-04-22 23:18:04 +09:00
Carsten Haitzler 9d55fab418 entry: wrong viewport value calculation issue fix
Summary:
Issue: As entire scroller edje co-ordinates was being taken instead of the actual viewport value,
if in scroller edje more parts are added apart from just "elm.swallow.content", then the viewport value
set will be wrong. hence the selection handlers will not hide when they have to hide.

solution: Instead of taking scroller edje's geometry, get the actual viewport values.
To get viewport x,y a new scrollable interface is also added.

signed-off by: Shilpa Singh <shilpa.singh@samsung.com>

@fix

Test Plan: Selection handlers have to hide correctly when the text is scrolled in a scrolled entry, if the scroller edc of entry has more parts added other than elm.swallow.content, then when we scroll the selection handlers are not hidden correctly.

Reviewers: jaehwan, woohyun, seoz, Hermet, raster

CC: govi, rajeshps, thiepha

Differential Revision: https://phab.enlightenment.org/D674
2014-04-21 12:31:49 +09:00
ChunEon Park 5ab6a7739f widgets - don't handle the events(key,mouse) if the object is disabled.
we can prevent to handle the widget events from the widget infra,
if the object is disabled.

conceptually, disabled object should not be interacted to user input(key, mouse)
2014-04-16 10:59:43 +09:00
Jaeun Choi fbcadfd87a list: apply key binding
Summary: This patch applies key binding to elm_list.

Test Plan: elementary_test > list > check key events

Reviewers: Hermet, raster, seoz

Differential Revision: https://phab.enlightenment.org/D727
2014-04-15 13:13:57 +09:00
Tom Hacohen 8f65677fff list: Adjusted to Eo2. 2014-04-10 09:35:01 +01:00
Daniel Juyung Seo 5cc573f361 list: Fixed _elm_list_item_content_focus_set in case the first content
is focused.

The function should return true when the first content of an item is
focused.

@fix
2014-04-07 04:13:01 +09:00
Daniel Juyung Seo 42483955ca list: Refactor direction key event handling routine in list.
- Added internal function _elm_list_elm_widget_event_direction.
- Simplified cascaded if statements.
- Note: focus_on_selection feature is still broken.
2014-04-07 04:12:41 +09:00
Daniel Juyung Seo a80edec90c list: Fixed _elm_list_item_content_focus_set misbehavior.
- Moved a check for direction at the start of the function based on the
horizontal mode configuration.
- Removed unnecessary focus set to edje object. In this case, that item
will get the focus automatically by elm widget item focus
infrastructure.

But this focus_on_selection feature is still broken. I need to fix them
more.
2014-04-07 03:10:21 +09:00
Amitesh Singh 68b3bc3583 focus: Renamed the config APIs _item_focus_on_selection_get/set to _item_select_on_focus_disabled_set/get()
Summary: - List: On Enter/Space/KP_Enter key press, focused item gets selected.

Test Plan: elementary_test->List Focus

Reviewers: seoz, raster

Reviewed By: seoz

CC: seoz

Differential Revision: https://phab.enlightenment.org/D704
2014-04-06 00:10:55 +09:00
Amitesh Singh 1479664ec0 list/genlist/gengrid/toolbar: Fix - _nearest_visible_item_get() should always return an item.
Test Plan:
Bug:
- elementary_test->genlist/list/toolbar/gengrid Focus
- Resize the window to a state when no item is fully visible. only partially visible.
- Move Focus from outer widgets (Up/Down/Left/right buttons) to list/genlist/gengrid/toolbar.
- Focus goes away (size - 0). Reason: _nearest_visible_item_get returns NULL.

@fix

Reviewers: seoz, raster, woohyun

Reviewed By: raster

CC: seoz, nirajkr, anand.km

Differential Revision: https://phab.enlightenment.org/D696
2014-04-04 12:04:04 +09:00
Amitesh Singh 73b16ef210 focus: Added optional focus feature - item focus on selection.
Summary:
Currenly focus and selection happens together. This patch makes item focus
on selection optional by configuration and API.

- configuration: "item_focus_on_selection".
- API: elm_config_item_focus_on_selection_get/set.
- Implemented item_focus_on_selection feature in elm list.
@feature

Test Plan: elementary_test->List focus

Reviewers: raster, seoz, woohyun

CC: seoz

Differential Revision: https://phab.enlightenment.org/D676
2014-04-03 19:11:57 +09:00
Amitesh Singh e8ce63b33d list: Added focus movement on widget items by mouse in.
Summary: @feature

Test Plan: elementary_test->List Focus

Reviewers: raster, cedric, woohyun

Reviewed By: raster

CC: seoz

Differential Revision: https://phab.enlightenment.org/D662
2014-04-01 20:23:24 +09:00
Daniel Zaoui 78d4ae4258 Eolian: Integration of List 2014-03-31 16:00:46 +03:00
Hosang Kim 7b4a539e9e list: Add item loop feature
Summary:
If item loop feature is enabled, item is moved infinitely.

1. add new widget api - item_loop_enabled
2. add smart event using new config - elm_list.c
3. add demo - test_list.c/list_focus

Reviewers: seoz, woohyun, raster, jaehwan, Hermet

CC: singh.amitesh, c

Differential Revision: https://phab.enlightenment.org/D619
2014-03-24 17:35:07 +09:00
Daniel Juyung Seo e79bbb2fb5 list: Check disabled status of an item in nearest visible item.
Also added a test for it.
2014-03-24 01:52:07 +09:00
Daniel Juyung Seo e5f9c254bd list: Fixed item multi/single selection routine to skip disabled item correctly.
@fix
2014-03-24 00:48:11 +09:00
Daniel Juyung Seo 7f0f50fbc6 list/genlist/gengrid: Internal refactoring of item_focused/unfocused
codes.

- Added a check for focus highlight enable status before calling focus
signal to edje.
- Used obj instead of WIDGET(it) because that is used many times.
2014-03-23 23:29:16 +09:00
Daniel Juyung Seo 26f4d3fcd9 list: Removed unnecessary check in focused_item_get.
focused_item is NULL if the list is unfocused so do not need to check if
the list is focused. Just return focused_item.
2014-03-23 23:28:26 +09:00
Daniel Juyung Seo 0288e89f17 list: Fixed annoying list scrolling issue when focus is back to list.
This patch is a list version of genlist patch cc827fef6.

Now, list does not autoscroll to last focused/selected item when the list
is focused. It tries to find the nearest visible item instead of the
last focused/selected item.
2014-03-23 19:14:18 +09:00
Daniel Juyung Seo fad3a2dfc4 list/genlist/gengrid: Handle on_focus event on focus set only for key
event.

When you use mouse(touch) that triggers mouse up event, the
focus/selection movement is done by mouse up callback, so don't need to
handle on_focus event when mouse(touch) is used.

You can reproduce the bug by the following step.
1. launch elementary_test -> list focus, genlist focus, gengrid focus
2. focus an item (by touch, by key)
3. move focus to left button (by touch, by key)
4. click an another item (by touch)
5. previously focused item will be unfocused again even it was unfocused
at step #3/

Special thanks to Amitesh for the report.
2014-03-23 16:48:10 +09:00
Daniel Juyung Seo ba36abd6d8 list: Added missing return from my previous commit ac0b3c. 2014-03-22 21:50:21 +09:00
Daniel Juyung Seo 65c948ca93 list/genlist/gengrid: Call item_show not bring_in on focus.
Elm 1.9 does item_show not bring_in so let's keep the consistency. I
will make this optional later.
2014-03-22 18:38:00 +09:00
Daniel Juyung Seo 1d14a57a8b list: Fixed heavily broken list item focus/selection movement.
Item selection also sets the focus automatically so do not need to set
focus twice. This code needs to be changed later again when the
selection by key arrow becomes optional.
2014-03-22 18:37:45 +09:00
Daniel Juyung Seo 6d211692bb list: Select the first item when the list widget is just focused first time.
Select the first item if there is no last_focused_item,
 last_selected_item, and if this focus is done by key event.
2014-03-22 18:14:19 +09:00
Daniel Juyung Seo ec2d28fc32 list: Fixed formatting before fixing a bug. 2014-03-22 18:06:42 +09:00
Daniel Juyung Seo bb4a6d181d list: Fixed item focus logic correctly by checking mouse down instead
of highlighted_item.

highlighted_item will be NULL after the first click and it is not
useful. To avoid first item focus -> first item unfocus -> clicked
item focus on the first focus to list widget, this patch is needed.

Thanks for the report Ceolin.
2014-03-22 18:01:22 +09:00
Daniel Juyung Seo e1fbcd35fe list: Focus a selected item. 2014-03-20 14:54:54 +09:00
Flavio Ceolin b364f7d9ba list: Avoiding the same item receive focus twice
When the item was activated by double click it received the focus twice
and the second is after had emitted the activated signal.
2014-03-18 17:43:14 -03:00
Flavio Ceolin 6c996a057d list: Fixing the focus on keyboard movement
Problem introduced on: fb13ad2
2014-03-18 17:15:36 -03:00
Daniel Juyung Seo 1c5f5ade61 list/genlist: Fixed Home and End key event handling routine.
Move focus and selection when Home or End key is pressed.

@fix
This needs a partial backport to elementary-1.9
2014-03-18 19:14:39 +09:00
Carsten Haitzler 53e1698ab8 warning-- 2014-03-18 17:34:30 +09:00
Daniel Zaoui 7460467419 Eolian: Integration of Scrollable Interface 2014-03-18 08:14:44 +02:00
Daniel Zaoui 8c29f2a77b Focus: fix segfault due to bad call to Eo function.
Due to Eolian auto-generation, legacy parameters are directly
transferred to Eo functions without conversion.

In this case, is_next was Eina_Bool in legacy and Eina_Bool * in Eo.
The logic code was expecting a pointer but was receiving a Eina_Bool.

The fix consists in giving the logic code the Eina_Bool instead of the
pointer.

@fix
2014-03-18 08:14:44 +02:00
Flavio Ceolin 7eef2ca491 elm:list: Avoiding two items be focused at same action
On a list that have not received focus yet a mouse down gives the focus
for the list (that gives the focus for the first item) and the mouse
up the item is selected and receive the focus.

The problem:  if the list is scrolled the focus given for the
first item makes the list scroll to the top and not for the item
selected by the user.
2014-03-17 19:11:59 -03:00
Daniel Zaoui e2206a1a22 Eolian: Integration of Elm Widget 2014-03-17 09:03:56 +02:00
Davide Andreoli f5a4489a62 elm_list: check sd not being null before access its members.
If the list is deleted/recteated the _elm_list_item_focused/unfocused() is
called and the sd pointer is null.

This unbreak all my apps that use elm_list
2014-03-15 22:38:28 +01:00
Daniel Juyung Seo 7100cfea40 list: Reset prev_focused_item when prev_focused_item is deleted.
This is inspired by a2c680d684601d8df725e8293616c880f07d3ca2.
2014-03-16 02:39:09 +09:00
Guilherme Iscaro de Godoy c4cad315ae Bug fix: Elm_List was not correctly setting the highlight theme for its items.
With the introduction of the patch 3628a8c4ea2485ee7ee5a81cfd4e0f0fe62b10d6,
it is possible to highlight focused Elm_List and Elm_Genlistenlist items.
However, this feature does not work correctly if one wants to create a custom
highlight theme for Elm_List items.
The whole problem was happening, because the function
_elm_widget_item_highlight_in_theme() was being called in a incorrect
location. This function must be called at _items_fix(), because
there the Elm_List already set the item theme and then it's possible
to check if the one wants a custom highlight or not.
2014-03-12 11:06:49 -03:00
Daniel Juyung Seo e60e43f8f5 list/genlist/gengrid: Clear some internal variables when an item is deleted.
Set last_selected_item, last_focused_item, focused_item to NULL when the
item is deleted.
For genlist and gengrid, clear them in del_not_serious.
2014-03-09 02:57:09 +09:00
Daniel Juyung Seo d626f9278f genlist/list: Fixed wrong internal function name.
_list/genlist_item_focus_set --> _list/genlist_item_content_focus_set.
These internal functions set the focus to the item's content objects,
 not the item itself. So the name was wrong and very confusing.
2014-03-08 03:27:09 +09:00
Daniel Juyung Seo 80f077cbec list: Do not call unnecessary external API.
We already know the internals so make it optimized by using internal
data.
2014-03-04 00:33:13 +09:00