Commit Graph

297 Commits

Author SHA1 Message Date
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
Daniel Juyung Seo ae324cfb36 list: Check NULL before calling _elm_list_item_unfocused.
unfocusing NULL item is nonsense. NULL needs to be checked before
calling item unfocus function.
2014-03-04 00:33:13 +09:00
Daniel Juyung Seo 8afae8de2e widget: removed unused widget item member 'focused'. 2014-03-02 01:24:23 +09:00
Daniel Juyung Seo 1a29ad5679 elm: removing trailing white space ceremony for 1.9 release. 2014-03-02 00:52:26 +09:00
Daniel Juyung Seo 3c23a57e2e list: Run focus set/unset routine only when the focus status is changed.
I didn't tag this as 'fix' because this feature was added after 1.9
release.
2014-03-02 00:26:08 +09:00
Gustavo Sverzut Barbieri 9f6a9a51e8 elm_list/focus: @bugfix crashes with empty lists and unfocused elements. 2014-02-28 01:57:23 -03:00
Amitesh Singh 38ac88d9d5 list: focus highlight is handled by item theme.
Summary:
Problem: list theme (elm/list/base/default) is an alias of scroller
base theme (elm/scroller/base/default) in which focus_highlight is set to "on".
Solution: Now focus highlight in_theme is set by list item theme.

Test Plan: elementary_test->"List Focus"

Reviewers: seoz, woohyun

Reviewed By: seoz

CC: nirajkr

Differential Revision: https://phab.enlightenment.org/D572
2014-02-26 01:27:05 +09:00
Amitesh Singh ff3521ba9e list: Code refractoring of _item_focused_next()
Summary:
  # Added code to handle the case of disabled items.
  #  Code refractoring of _item_focused_next().

Test Plan: elementary_test->"list focus"

Reviewers: seoz, woohyun

CC: nirajkr

Differential Revision: https://phab.enlightenment.org/D571
2014-02-26 01:26:57 +09:00
Amitesh Singh 069a3de27d list: implemented widget item focus feature.
@feature

Summary:

  #    Added "item,focused" and "item,unfocused" smart callbacks.
  # Added elm_object_focused_item_get() in elm_widget
  # Added elm_object_item_focus_set and elm_object_item_focus_get() APIs for
  # Added one argument in existing _focus_highlight_geometry_get(...,is_next)
  This is required to find out previous and current widget item.
  # Added a elm_win function _focus_highlight_start() which starts the focus

Test Plan: elementary_test->List Focus , List Horizontal Focus

Reviewers: seoz, woohyun

Reviewers Comments: SeoZ - there are some known bugs. we will actively
fix them in a near future.

CC: nirajkr

Differential Revision: https://phab.enlightenment.org/D532
2014-02-26 01:26:22 +09:00
Daniel Juyung Seo ff18fac8e7 list: fixed list to emit elm,state,list,single signal when there is only
one item.

This is a fix of a commit 44495f6431cdc5dbe6e8cb257cf73a69563ec67c.
2014-02-25 00:58:54 +09:00
Gustavo Lima Chaves c80868da12 Elm list, like genlist, should emit 1st/middle/last signals to its items.
So that one is able to theme these cases accordingly.
2014-02-20 14:10:10 -03:00
Carsten Haitzler c45fd8aff3 list - fix mode set to have override power over scroll limit api 2014-02-14 12:19:40 +09:00
Jaehwan Kim db23689614 access: Add smart signal "access,changed"
It occurs that access mode is changed.
Application can add this callback for each widget.
2014-02-08 14:05:14 +09:00
WooHyun Jung 0a1179dde4 elm_layout now supports focused/unfocused smart callback
by itself for widgets that inherit layout class.
If it uses elm_widget's, smart callback will be called at the
beginning or smart_on_focus function.
2014-02-06 16:18:57 +09:00
Daniel Juyung Seo b74c805a74 list: Used macro for list swipe time like genlist. 2014-01-23 23:11:12 +09:00
ChunEon Park f8d00ae0f2 elementary - override widget translation but work also the base widget's behavior.
Some widgets override the widget translation but it didn't inherit the base widget's function.
Becuase of it,The language changed won't be properly called in the widget tree.

Now it fixed it.
2014-01-23 20:20:43 +09:00
ChunEon Park dbacb2fef9 elementary - send signal "language,changed" with one way in the widget.
Call the smart callback in the widget infra so that each widget don't need to hook the smart_translate only for the smart call.

This makes reducing duplicated code and supporting language,chagned from all widgets.
2014-01-23 19:30:34 +09:00
ChunEon Park aebdcff513 elementary - use the focused/unfocused string in widget defined.
Now, it will share the strings so that reduce the binary size also user uses it in one way.
2014-01-23 17:27:17 +09:00