- more work on keyboard nav, now window scrolls when we move with keys. still have bug in top topmost first item and lowermost right item.

SVN revision: 18307
This commit is contained in:
codewarrior 2005-11-05 01:01:26 +00:00 committed by codewarrior
parent bdd04a90d2
commit 5e89f6761b
3 changed files with 110 additions and 6 deletions

View File

@ -26,7 +26,8 @@ static void _e_fileman_scroll_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
static void _e_fileman_scroll_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
static void _e_fileman_scroll_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
static void _e_fileman_scroll_child_size_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
static int _e_fileman_reconfigure_cb(void *data, int type, void *event);
E_Fileman *
e_fileman_new(E_Container *con)
@ -90,6 +91,12 @@ e_fileman_new(E_Container *con)
evas_event_thaw(fileman->evas);
fileman->event_handlers = evas_list_append(fileman->event_handlers,
ecore_event_handler_add(E_EVENT_FM_RECONFIGURE,
_e_fileman_reconfigure_cb,
fileman));
D(("e_fileman_new: ok\n"));
return fileman;
@ -192,3 +199,15 @@ _e_fileman_selector_cb(Evas_Object *object, char *file, void *data)
fileman->selector.func(fileman, file, fileman->selector.data);
//e_object_del(E_OBJECT(fileman));
}
static int
_e_fileman_reconfigure_cb(void *data, int type, void *event)
{
E_Event_Fm_Reconfigure *ev;
E_Fileman *fileman;
fileman = data;
ev = event;
e_scrollframe_child_region_show(fileman->main, ev->x, ev->y, ev->w, ev->h);
}

View File

@ -645,7 +645,6 @@ _e_fm_smart_move(Evas_Object *object, Evas_Coord x, Evas_Coord y)
sd->x = x;
sd->y = y;
evas_object_move(sd->bg, x, y);
evas_object_move(sd->clip, x, y);
evas_object_move(sd->layout, sd->x - sd->child.x, sd->y - sd->child.y);
@ -685,7 +684,7 @@ _e_fm_smart_resize(Evas_Object *object, Evas_Coord w, Evas_Coord h)
ev->object = sd->object;
ev->w = sd->child.w;
ev->h = sd->child.h;
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
//ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
}
}
@ -765,7 +764,7 @@ _e_fm_redraw(E_Fm_Smart_Data *sd)
ev->object = sd->object;
ev->w = sd->child.w;
ev->h = sd->child.h;
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
//ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
}
}
@ -1413,7 +1412,7 @@ _e_fm_dir_set(E_Fm_Smart_Data *sd, const char *dir)
ev->object = sd->object;
ev->w = sd->child.w;
ev->h = sd->child.h;
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
//ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
}
}
@ -2263,6 +2262,28 @@ _e_fm_icon_select_up(E_Fm_Smart_Data *sd)
_e_fm_selections_clear(sd);
_e_fm_selections_add(l->data, l);
}
if(l)
{
E_Fm_Icon *icon;
Evas_Coord x, y, w, h;
icon = l->data;
evas_object_geometry_get(icon->icon_object, &x, &y, &w, &h);
if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
{
E_Event_Fm_Reconfigure *ev;
ev = E_NEW(E_Event_Fm_Reconfigure, 1);
if (ev)
{
ev->object = sd->object;
ev->x = sd->x;
ev->y = sd->child.y - (sd->y - (y - sd->icon_info.y_space));
ev->w = sd->w;
ev->h = sd->h;
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
}
}
}
}
else
_e_fm_selections_add(sd->files->data, sd->files);
@ -2306,6 +2327,28 @@ _e_fm_icon_select_down(E_Fm_Smart_Data *sd)
_e_fm_selections_clear(sd);
_e_fm_selections_add(l->data, l);
}
if(l)
{
E_Fm_Icon *icon;
Evas_Coord x, y, w, h;
icon = l->data;
evas_object_geometry_get(icon->icon_object, &x, &y, &w, &h);
if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
{
E_Event_Fm_Reconfigure *ev;
ev = E_NEW(E_Event_Fm_Reconfigure, 1);
if (ev)
{
ev->object = sd->object;
ev->x = sd->x;
ev->y = sd->child.y + y + h + sd->icon_info.y_space - (sd->y + sd->h);
ev->w = sd->w;
ev->h = sd->h;
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
}
}
}
}
else
_e_fm_selections_add(sd->files->data, sd->files);
@ -2339,6 +2382,27 @@ _e_fm_icon_select_left(E_Fm_Smart_Data *sd)
_e_fm_selections_clear(sd);
_e_fm_selections_add(prev->data, prev);
}
{
E_Fm_Icon *icon;
Evas_Coord x, y, w, h;
icon = prev->data;
evas_object_geometry_get(icon->icon_object, &x, &y, &w, &h);
if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
{
E_Event_Fm_Reconfigure *ev;
ev = E_NEW(E_Event_Fm_Reconfigure, 1);
if (ev)
{
ev->object = sd->object;
ev->x = sd->x;
ev->y = sd->child.y - (sd->y - (y - sd->icon_info.y_space));
ev->w = sd->w;
ev->h = sd->h;
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
}
}
}
}
}
else
@ -2372,6 +2436,27 @@ _e_fm_icon_select_right(E_Fm_Smart_Data *sd)
{
_e_fm_selections_clear(sd);
_e_fm_selections_add(next->data, next);
}
{
E_Fm_Icon *icon;
Evas_Coord x, y, w, h;
icon = next->data;
evas_object_geometry_get(icon->icon_object, &x, &y, &w, &h);
if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
{
E_Event_Fm_Reconfigure *ev;
ev = E_NEW(E_Event_Fm_Reconfigure, 1);
if (ev)
{
ev->object = sd->object;
ev->x = sd->x;
ev->y = sd->child.y + y + h + sd->icon_info.y_space - (sd->y + sd->h);
ev->w = sd->w;
ev->h = sd->h;
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
}
}
}
}
}

View File

@ -13,7 +13,7 @@ typedef struct _E_Event_Fm_Directory_Change E_Event_Fm_Directory_Change;
struct _E_Event_Fm_Reconfigure
{
Evas_Object *object;
Evas_Coord w, h;
Evas_Coord x, y, w, h;
};
struct _E_Event_Fm_Directory_Change