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)
downloadelementary-aa5b83d76aa371e6de4e0a1c45cc31e72646ecdf.tar.gz
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)
if (!sd->box) return EINA_FALSE;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "previous"))
elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
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)
eo_litem = eina_list_last_data_get(sd->items);
eo_fitem = eina_list_data_get(sd->items);
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "down"))
{
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)
ELM_PLAYER_DATA_GET(obj, sd);
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "left"))
{
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)
{
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "previous"))
elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
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)
ELM_CALENDAR_DATA_GET(obj, sd);
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "prior"))
{
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)
char colorbar_s[128];
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "left"))
{
if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected)
cl = eina_list_prev(sd->selected);
- else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
+ else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
_button_clicked_cb(sd->cb_data[sd->sel_color_type],
sd->cb_data[sd->sel_color_type]->lbt, NULL, NULL);
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)
Eina_List *l = NULL;
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "prev"))
{
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)
if (sd->reorder_mode && sd->reorder.running) return EINA_TRUE;
+ _elm_widget_focus_auto_show(obj);
if ((!strcmp(dir, "left") && !mirrored) ||
(!strcmp(dir, "right") && mirrored))
{
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)
elm_interface_scrollable_content_viewport_geometry_get
(NULL, NULL, &v_w, &v_h));
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "left"))
{
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)
elm_interface_scrollable_content_viewport_geometry_get
(NULL, NULL, &v_w, &v_h));
+ _elm_widget_focus_auto_show(obj);
/* TODO: fix logic for horizontal mode */
if (!strcmp(dir, "left"))
{
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);
const void *_elm_module_symbol_get(Elm_Module *m,
const char *name);
+void _elm_widget_focus_auto_show(Evas_Object *obj);
void _elm_widget_top_win_focused_set(Evas_Object *obj,
Eina_Bool top_win_focused);
Eina_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)
(&v_x, &v_y, &v_w, &v_h));
evas_object_geometry_get(sd->content, &c_x, &c_y, &max_x, &max_y);
+ _elm_widget_focus_auto_show(obj);
+
current_focus = elm_widget_focused_object_get(obj);
evas_object_geometry_get(current_focus, &f_x, &f_y, &f_w, &f_h);
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)
{
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "left"))
{
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)
{
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "left"))
{
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)
{
const char *dir = params;
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "left"))
{
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
_elm_widget_focus_cycle(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Elm_Focus_Direction dir)
{
Evas_Object *target = NULL;
+
if (!_elm_widget_is(obj))
return;
focus_origin = dir;
@@ -2890,6 +2891,13 @@ _elm_widget_focus_restore(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
}
void
+_elm_widget_focus_auto_show(Evas_Object *obj)
+{
+ Evas_Object *top = elm_widget_top_get(obj);
+ if (top && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_show(top);
+}
+
+void
_elm_widget_top_win_focused_set(Evas_Object *obj,
Eina_Bool top_win_focused)
{
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
_key_action_move(Evas_Object *obj, const char *params)
{
const char *dir = params;
- Evas_Object *top;
- top = elm_widget_top_get(obj);
- if (top && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_show(top);
+ _elm_widget_focus_auto_show(obj);
if (!strcmp(dir, "previous"))
elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
else if (!strcmp(dir, "next"))