forked from enlightenment/enlightenment
-m pressing a key like "i" will take you to "images" and "C" takes you to "Code". Wrapping is also supported."
SVN revision: 18345
This commit is contained in:
parent
5254391537
commit
63f95267e9
|
@ -85,7 +85,7 @@ e_fileman_new(E_Container *con)
|
|||
_e_fileman_scroll_child_size_get);
|
||||
|
||||
e_win_resize_callback_set(fileman->win, _e_fileman_resize_cb);
|
||||
e_win_resize(fileman->win, 640, 480);
|
||||
e_win_resize(fileman->win, 570, 355);
|
||||
|
||||
ecore_x_dnd_aware_set(fileman->win->evas_win, 1);
|
||||
|
||||
|
|
|
@ -237,6 +237,13 @@ static void _e_fm_icon_mouse_out_cb (void *data, Evas *e, Evas_O
|
|||
static void _e_fm_icon_mouse_move_cb (void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static int _e_fm_win_mouse_up_cb (void *data, int type, void *event);
|
||||
|
||||
static void _e_fm_icon_select_up(E_Fm_Smart_Data *sd);
|
||||
static void _e_fm_icon_select_down(E_Fm_Smart_Data *sd);
|
||||
static void _e_fm_icon_select_left(E_Fm_Smart_Data *sd);
|
||||
static void _e_fm_icon_select_right(E_Fm_Smart_Data *sd);
|
||||
static void _e_fm_icon_goto_key(E_Fm_Smart_Data *sd, char *c);
|
||||
|
||||
|
||||
static int _e_fm_drop_enter_cb (void *data, int type, void *event);
|
||||
static int _e_fm_drop_leave_cb (void *data, int type, void *event);
|
||||
static int _e_fm_drop_position_cb (void *data, int type, void *event);
|
||||
|
@ -2226,6 +2233,69 @@ _e_fm_win_mouse_up_cb(void *data, int type, void *event)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_fm_icon_goto_key(E_Fm_Smart_Data *sd, char *c)
|
||||
{
|
||||
E_Fm_Icon *icon;
|
||||
Evas_List *l;
|
||||
|
||||
if(sd->selection.current.ptr)
|
||||
{
|
||||
l = sd->selection.current.ptr;
|
||||
icon = sd->selection.current.file;
|
||||
if(icon->file->name[0] == c[0] && l->next)
|
||||
l = l->next;
|
||||
else
|
||||
l = sd->selection.current.ptr;
|
||||
}
|
||||
else
|
||||
l = sd->files;
|
||||
|
||||
for(l; l; l = l->next)
|
||||
{
|
||||
icon = l->data;
|
||||
if(icon->file->name[0] == c[0])
|
||||
{
|
||||
_e_fm_selections_clear(sd);
|
||||
_e_fm_selections_add(l->data, l);
|
||||
goto position;
|
||||
}
|
||||
}
|
||||
for(l = sd->files; l != sd->selection.current.ptr; l = l->next)
|
||||
{
|
||||
icon = l->data;
|
||||
if(icon->file->name[0] == c[0])
|
||||
{
|
||||
_e_fm_selections_clear(sd);
|
||||
_e_fm_selections_add(l->data, l);
|
||||
goto position;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
position:
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_fm_icon_select_up(E_Fm_Smart_Data *sd)
|
||||
{
|
||||
|
@ -2290,7 +2360,7 @@ _e_fm_icon_select_up(E_Fm_Smart_Data *sd)
|
|||
ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
_e_fm_selections_add(sd->files->data, sd->files);
|
||||
|
@ -2536,7 +2606,9 @@ _e_fm_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
else if (!strcmp(ev->keyname, "Right"))
|
||||
_e_fm_icon_select_right(sd);
|
||||
else if (!strcmp(ev->keyname, "Return"))
|
||||
_e_fm_icon_run(sd);
|
||||
_e_fm_icon_run(sd);
|
||||
else if(strlen(ev->keyname) == 1)
|
||||
_e_fm_icon_goto_key(sd, ev->string);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue