Fix Gengrid keyboard navigation on horizontal mode

SVN revision: 54410
This commit is contained in:
Bruno Dilly 2010-11-10 18:04:28 +00:00
parent 8922b61b38
commit cdbd1bae85
1 changed files with 74 additions and 18 deletions

View File

@ -272,9 +272,18 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
{
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_left(wd)))
|| (_item_single_select_left(wd)))
if ((wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_up(wd)))
|| (_item_single_select_up(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
else if ((!wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_left(wd)))
|| (_item_single_select_left(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
@ -284,9 +293,18 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
}
else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")))
{
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_right(wd)))
|| (_item_single_select_right(wd)))
if ((wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_down(wd)))
|| (_item_single_select_down(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
else if ((!wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_right(wd)))
|| (_item_single_select_right(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
@ -296,9 +314,18 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
}
else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")))
{
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_up(wd)))
|| (_item_single_select_up(wd)))
if ((wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_left(wd)))
|| (_item_single_select_left(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
else if ((!wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_up(wd)))
|| (_item_single_select_up(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
@ -308,9 +335,18 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
}
else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")))
{
if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_down(wd)))
|| (_item_single_select_down(wd)))
if ((wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_right(wd)))
|| (_item_single_select_right(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
}
else if ((!wd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(_item_multi_select_down(wd)))
|| (_item_single_select_down(wd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
return EINA_TRUE;
@ -334,17 +370,37 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
}
else if (!strcmp(ev->keyname, "Prior"))
{
if (page_y < 0)
y -= -(page_y * v_h) / 100;
if (wd->horizontal)
{
if (page_x < 0)
x -= -(page_x * v_w) / 100;
else
x -= page_x;
}
else
y -= page_y;
{
if (page_y < 0)
y -= -(page_y * v_h) / 100;
else
y -= page_y;
}
}
else if (!strcmp(ev->keyname, "Next"))
{
if (page_y < 0)
y += -(page_y * v_h) / 100;
if (wd->horizontal)
{
if (page_x < 0)
x += -(page_x * v_w) / 100;
else
x += page_x;
}
else
y += page_y;
{
if (page_y < 0)
y += -(page_y * v_h) / 100;
else
y += page_y;
}
}
else if (!strcmp(ev->keyname, "Escape"))
{