fsel now properly selects the first file in a directory on directory load/change

SVN revision: 75017
This commit is contained in:
Mike Blumenkrantz 2012-08-08 12:32:31 +00:00
parent ac28718562
commit 5c9aeaaa47
1 changed files with 14 additions and 1 deletions

View File

@ -165,6 +165,17 @@ _e_wid_fsel_files_changed(void *data, Evas_Object *obj __UNUSED__, void *event_i
{
E_Widget_Data *wd;
wd = data;
if (!wd->o_files_fm) return;
if (e_fm2_selected_count(wd->o_files_fm)) return;
e_fm2_first_sel(wd->o_files_fm);
}
static void
_e_wid_fsel_files_dir_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
E_Widget_Data *wd;
wd = data;
if (!wd->o_files_fm) return;
if (!e_fm2_has_parent_get(wd->o_files_fm))
@ -391,8 +402,10 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
fmc.view.no_click_rename = 1;
e_fm2_config_set(o, &fmc);
e_fm2_icon_menu_flags_set(o, E_FM2_MENU_NO_VIEW_MENU);
evas_object_smart_callback_add(o, "dir_changed",
evas_object_smart_callback_add(o, "changed",
_e_wid_fsel_files_changed, wd);
evas_object_smart_callback_add(o, "dir_changed",
_e_wid_fsel_files_dir_changed, wd);
evas_object_smart_callback_add(o, "selection_change",
_e_wid_fsel_files_selection_change, wd);
evas_object_smart_callback_add(o, "selected",