From 82a28dafb91820da9cac0003bfedc8ce5a991ac2 Mon Sep 17 00:00:00 2001 From: Tiago Rezende Campos Falcao Date: Fri, 15 Oct 2010 17:28:33 +0000 Subject: [PATCH] Better focus next get to elm panes. The previous have too much code. SVN revision: 53459 --- legacy/elementary/src/lib/elm_panes.c | 35 ++++++++++----------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/legacy/elementary/src/lib/elm_panes.c b/legacy/elementary/src/lib/elm_panes.c index 17872565bd..87917e264b 100644 --- a/legacy/elementary/src/lib/elm_panes.c +++ b/legacy/elementary/src/lib/elm_panes.c @@ -98,30 +98,21 @@ _elm_panes_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas else return EINA_FALSE; - if (elm_widget_focus_get(chain[1])) + unsigned char i = elm_widget_focus_get(chain[1]); + + if (elm_widget_focus_next_get(chain[i], dir, next)) + return TRUE; + + i = !i; + + Evas_Object *to_focus; + if (elm_widget_focus_next_get(chain[i], dir, &to_focus)) { - Evas_Object *to_focus; - if (elm_widget_focus_next_get(chain[1], dir, next)) - return EINA_TRUE; - elm_widget_focus_next_get(chain[0], dir, &to_focus); - if (to_focus) - *next = to_focus; - return EINA_FALSE; - } - else - { - Evas_Object *to_focus; - if (elm_widget_focus_next_get(chain[0], dir, next)) - return EINA_TRUE; - if (elm_widget_focus_next_get(chain[1], dir, &to_focus)) - { - *next = to_focus; - return EINA_TRUE; - } - if (!(*next)) - *next = to_focus; - return EINA_FALSE; + *next = to_focus; + return !!i; } + + return EINA_FALSE; } static void