summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-10 18:29:24 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-10 18:29:24 +0900
commitaa5b83d76aa371e6de4e0a1c45cc31e72646ecdf (patch)
tree07e786f715aa258ebfb69d652b0069985bf78962
parentcfff788b62d742fee76655026063719dc149f81e (diff)
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
-rw-r--r--src/lib/elc_ctxpopup.c1
-rw-r--r--src/lib/elc_hoversel.c1
-rw-r--r--src/lib/elc_player.c1
-rw-r--r--src/lib/elc_popup.c1
-rw-r--r--src/lib/elm_calendar.c1
-rw-r--r--src/lib/elm_colorselector.c3
-rw-r--r--src/lib/elm_diskselector.c1
-rw-r--r--src/lib/elm_gengrid.c1
-rw-r--r--src/lib/elm_genlist.c1
-rw-r--r--src/lib/elm_list.c1
-rw-r--r--src/lib/elm_priv.h1
-rw-r--r--src/lib/elm_scroller.c2
-rw-r--r--src/lib/elm_slideshow.c1
-rw-r--r--src/lib/elm_toolbar.c1
-rw-r--r--src/lib/elm_video.c1
-rw-r--r--src/lib/elm_widget.c8
-rw-r--r--src/lib/elm_win.c4
17 files changed, 26 insertions, 4 deletions
diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c
index d371459e9..73954d4db 100644
--- a/src/lib/elc_ctxpopup.c
+++ b/src/lib/elc_ctxpopup.c
@@ -115,6 +115,7 @@ _key_action_move(Evas_Object *obj, const char *params)
115 115
116 if (!sd->box) return EINA_FALSE; 116 if (!sd->box) return EINA_FALSE;
117 117
118 _elm_widget_focus_auto_show(obj);
118 if (!strcmp(dir, "previous")) 119 if (!strcmp(dir, "previous"))
119 elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS); 120 elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
120 else if (!strcmp(dir, "next")) 121 else if (!strcmp(dir, "next"))
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index c25fb6abe..b8289317c 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -677,6 +677,7 @@ _key_action_move(Evas_Object *obj, const char *params)
677 eo_litem = eina_list_last_data_get(sd->items); 677 eo_litem = eina_list_last_data_get(sd->items);
678 eo_fitem = eina_list_data_get(sd->items); 678 eo_fitem = eina_list_data_get(sd->items);
679 679
680 _elm_widget_focus_auto_show(obj);
680 if (!strcmp(dir, "down")) 681 if (!strcmp(dir, "down"))
681 { 682 {
682 if ((!sd->horizontal) && 683 if ((!sd->horizontal) &&
diff --git a/src/lib/elc_player.c b/src/lib/elc_player.c
index 91e38ed43..1eeb35d3f 100644
--- a/src/lib/elc_player.c
+++ b/src/lib/elc_player.c
@@ -72,6 +72,7 @@ _key_action_move(Evas_Object *obj, const char *params)
72 ELM_PLAYER_DATA_GET(obj, sd); 72 ELM_PLAYER_DATA_GET(obj, sd);
73 const char *dir = params; 73 const char *dir = params;
74 74
75 _elm_widget_focus_auto_show(obj);
75 if (!strcmp(dir, "left")) 76 if (!strcmp(dir, "left"))
76 { 77 {
77 double current, last; 78 double current, last;
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index ed9cc85b4..7e5694688 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -1419,6 +1419,7 @@ _key_action_move(Evas_Object *obj, const char *params)
1419{ 1419{
1420 const char *dir = params; 1420 const char *dir = params;
1421 1421
1422 _elm_widget_focus_auto_show(obj);
1422 if (!strcmp(dir, "previous")) 1423 if (!strcmp(dir, "previous"))
1423 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS); 1424 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1424 else if (!strcmp(dir, "next")) 1425 else if (!strcmp(dir, "next"))
diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c
index fe0102ad4..4ecfb4986 100644
--- a/src/lib/elm_calendar.c
+++ b/src/lib/elm_calendar.c
@@ -933,6 +933,7 @@ _key_action_move(Evas_Object *obj, const char *params)
933 ELM_CALENDAR_DATA_GET(obj, sd); 933 ELM_CALENDAR_DATA_GET(obj, sd);
934 const char *dir = params; 934 const char *dir = params;
935 935
936 _elm_widget_focus_auto_show(obj);
936 if (!strcmp(dir, "prior")) 937 if (!strcmp(dir, "prior"))
937 { 938 {
938 if (_update_data(obj, EINA_TRUE, -1)) _populate(obj); 939 if (_update_data(obj, EINA_TRUE, -1)) _populate(obj);
diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index f53548e41..ee9a96f1c 100644
--- a/src/lib/elm_colorselector.c
+++ b/src/lib/elm_colorselector.c
@@ -1829,11 +1829,12 @@ _key_action_move(Evas_Object *obj, const char *params)
1829 char colorbar_s[128]; 1829 char colorbar_s[128];
1830 const char *dir = params; 1830 const char *dir = params;
1831 1831
1832 _elm_widget_focus_auto_show(obj);
1832 if (!strcmp(dir, "left")) 1833 if (!strcmp(dir, "left"))
1833 { 1834 {
1834 if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected) 1835 if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected)
1835 cl = eina_list_prev(sd->selected); 1836 cl = eina_list_prev(sd->selected);
1836 else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS) 1837 else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
1837 _button_clicked_cb(sd->cb_data[sd->sel_color_type], 1838 _button_clicked_cb(sd->cb_data[sd->sel_color_type],
1838 sd->cb_data[sd->sel_color_type]->lbt, NULL, NULL); 1839 sd->cb_data[sd->sel_color_type]->lbt, NULL, NULL);
1839 else return EINA_FALSE; 1840 else return EINA_FALSE;
diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c
index 70d5f3bb4..54fe8c5ff 100644
--- a/src/lib/elm_diskselector.c
+++ b/src/lib/elm_diskselector.c
@@ -962,6 +962,7 @@ _key_action_move(Evas_Object *obj, const char *params)
962 Eina_List *l = NULL; 962 Eina_List *l = NULL;
963 const char *dir = params; 963 const char *dir = params;
964 964
965 _elm_widget_focus_auto_show(obj);
965 if (!strcmp(dir, "prev")) 966 if (!strcmp(dir, "prev"))
966 { 967 {
967 l = sd->selected_item->node->prev; 968 l = sd->selected_item->node->prev;
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 66a8eff01..d351b53d8 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -3054,6 +3054,7 @@ _key_action_move(Evas_Object *obj, const char *params)
3054 3054
3055 if (sd->reorder_mode && sd->reorder.running) return EINA_TRUE; 3055 if (sd->reorder_mode && sd->reorder.running) return EINA_TRUE;
3056 3056
3057 _elm_widget_focus_auto_show(obj);
3057 if ((!strcmp(dir, "left") && !mirrored) || 3058 if ((!strcmp(dir, "left") && !mirrored) ||
3058 (!strcmp(dir, "right") && mirrored)) 3059 (!strcmp(dir, "right") && mirrored))
3059 { 3060 {
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index e620c47f0..a839fc108 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2894,6 +2894,7 @@ _key_action_move(Evas_Object *obj, const char *params)
2894 elm_interface_scrollable_content_viewport_geometry_get 2894 elm_interface_scrollable_content_viewport_geometry_get
2895 (NULL, NULL, &v_w, &v_h)); 2895 (NULL, NULL, &v_w, &v_h));
2896 2896
2897 _elm_widget_focus_auto_show(obj);
2897 if (!strcmp(dir, "left")) 2898 if (!strcmp(dir, "left"))
2898 { 2899 {
2899 x -= step_x; 2900 x -= step_x;
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index dddd7b4ee..498a79e49 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -474,6 +474,7 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
474 elm_interface_scrollable_content_viewport_geometry_get 474 elm_interface_scrollable_content_viewport_geometry_get
475 (NULL, NULL, &v_w, &v_h)); 475 (NULL, NULL, &v_w, &v_h));
476 476
477 _elm_widget_focus_auto_show(obj);
477 /* TODO: fix logic for horizontal mode */ 478 /* TODO: fix logic for horizontal mode */
478 if (!strcmp(dir, "left")) 479 if (!strcmp(dir, "left"))
479 { 480 {
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index 61bba21cb..0b03d54ab 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -402,6 +402,7 @@ void _elm_module_unload(Elm_Module *m);
402const void *_elm_module_symbol_get(Elm_Module *m, 402const void *_elm_module_symbol_get(Elm_Module *m,
403 const char *name); 403 const char *name);
404 404
405void _elm_widget_focus_auto_show(Evas_Object *obj);
405void _elm_widget_top_win_focused_set(Evas_Object *obj, 406void _elm_widget_top_win_focused_set(Evas_Object *obj,
406 Eina_Bool top_win_focused); 407 Eina_Bool top_win_focused);
407Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj); 408Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c
index e041a4431..22e0684f9 100644
--- a/src/lib/elm_scroller.c
+++ b/src/lib/elm_scroller.c
@@ -113,6 +113,8 @@ _key_action_move(Evas_Object *obj, const char *params)
113 (&v_x, &v_y, &v_w, &v_h)); 113 (&v_x, &v_y, &v_w, &v_h));
114 evas_object_geometry_get(sd->content, &c_x, &c_y, &max_x, &max_y); 114 evas_object_geometry_get(sd->content, &c_x, &c_y, &max_x, &max_y);
115 115
116 _elm_widget_focus_auto_show(obj);
117
116 current_focus = elm_widget_focused_object_get(obj); 118 current_focus = elm_widget_focused_object_get(obj);
117 evas_object_geometry_get(current_focus, &f_x, &f_y, &f_w, &f_h); 119 evas_object_geometry_get(current_focus, &f_x, &f_y, &f_w, &f_h);
118 can_focus_list = elm_widget_can_focus_child_list_get(obj); 120 can_focus_list = elm_widget_can_focus_child_list_get(obj);
diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c
index 7d9c454d4..ae8146cf4 100644
--- a/src/lib/elm_slideshow.c
+++ b/src/lib/elm_slideshow.c
@@ -43,6 +43,7 @@ _key_action_move(Evas_Object *obj, const char *params)
43{ 43{
44 const char *dir = params; 44 const char *dir = params;
45 45
46 _elm_widget_focus_auto_show(obj);
46 if (!strcmp(dir, "left")) 47 if (!strcmp(dir, "left"))
47 { 48 {
48 elm_slideshow_previous(obj); 49 elm_slideshow_previous(obj);
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index 0061934ac..4b3841e05 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -912,6 +912,7 @@ _key_action_move(Evas_Object *obj, const char *params)
912{ 912{
913 const char *dir = params; 913 const char *dir = params;
914 914
915 _elm_widget_focus_auto_show(obj);
915 if (!strcmp(dir, "left")) 916 if (!strcmp(dir, "left"))
916 { 917 {
917 if (!_item_focused_next(obj, EINA_TRUE, ELM_FOCUS_LEFT)) 918 if (!_item_focused_next(obj, EINA_TRUE, ELM_FOCUS_LEFT))
diff --git a/src/lib/elm_video.c b/src/lib/elm_video.c
index 80aa739e2..350297152 100644
--- a/src/lib/elm_video.c
+++ b/src/lib/elm_video.c
@@ -41,6 +41,7 @@ _key_action_move(Evas_Object *obj, const char *params)
41{ 41{
42 const char *dir = params; 42 const char *dir = params;
43 43
44 _elm_widget_focus_auto_show(obj);
44 if (!strcmp(dir, "left")) 45 if (!strcmp(dir, "left"))
45 { 46 {
46 double current, last; 47 double current, last;
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index db963b76c..49fe1ac5f 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -1845,6 +1845,7 @@ EOLIAN static void
1845_elm_widget_focus_cycle(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Elm_Focus_Direction dir) 1845_elm_widget_focus_cycle(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Elm_Focus_Direction dir)
1846{ 1846{
1847 Evas_Object *target = NULL; 1847 Evas_Object *target = NULL;
1848
1848 if (!_elm_widget_is(obj)) 1849 if (!_elm_widget_is(obj))
1849 return; 1850 return;
1850 focus_origin = dir; 1851 focus_origin = dir;
@@ -2890,6 +2891,13 @@ _elm_widget_focus_restore(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
2890} 2891}
2891 2892
2892void 2893void
2894_elm_widget_focus_auto_show(Evas_Object *obj)
2895{
2896 Evas_Object *top = elm_widget_top_get(obj);
2897 if (top && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_show(top);
2898}
2899
2900void
2893_elm_widget_top_win_focused_set(Evas_Object *obj, 2901_elm_widget_top_win_focused_set(Evas_Object *obj,
2894 Eina_Bool top_win_focused) 2902 Eina_Bool top_win_focused)
2895{ 2903{
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index e75ee1d02..453bb2f31 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -1507,10 +1507,8 @@ static Eina_Bool
1507_key_action_move(Evas_Object *obj, const char *params) 1507_key_action_move(Evas_Object *obj, const char *params)
1508{ 1508{
1509 const char *dir = params; 1509 const char *dir = params;
1510 Evas_Object *top;
1511 1510
1512 top = elm_widget_top_get(obj); 1511 _elm_widget_focus_auto_show(obj);
1513 if (top && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_show(top);
1514 if (!strcmp(dir, "previous")) 1512 if (!strcmp(dir, "previous"))
1515 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS); 1513 elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
1516 else if (!strcmp(dir, "next")) 1514 else if (!strcmp(dir, "next"))