efm - rename - select all up to the first dot so extension stays

devs/bu5hm4n/swipe_real
Carsten Haitzler 2 years ago
parent a6b870266c
commit b288373ee6
  1. 11
      src/bin/e_fm.c
  2. 10
      src/bin/e_widget_entry.c
  3. 4
      src/bin/e_widget_entry.h

@ -10483,7 +10483,16 @@ _e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
e_widget_entry_text_set(ic->entry_widget, ic->info.file);
e_widget_focus_set(ic->entry_widget, 1);
ic->focus_hook = e_client_hook_add(E_CLIENT_HOOK_FOCUS_SET, _e_fm2_icon_entry_widget_focus_out, ic);
e_widget_entry_select_all(ic->entry_widget);
char *dot = strchr(ic->info.file, '.');
if (dot)
{
int end = (int)((long)(dot - ic->info.file));
printf("SEL: %i -> %i\n", 0, end);
e_widget_entry_select_set(ic->entry_widget, 0,
(int)((long)(dot - ic->info.file)));
}
else
e_widget_entry_select_all(ic->entry_widget);
ic->sd->iop_icon = ic;
ic->sd->typebuf.disabled = EINA_TRUE;
if (e_comp->comp_type == E_PIXMAP_TYPE_X)

@ -215,6 +215,16 @@ e_widget_entry_select_all(Evas_Object *entry)
elm_entry_select_all(wd->o_entry);
}
E_API void
e_widget_entry_select_set(Evas_Object *entry, int start, int end)
{
E_Widget_Data *wd;
if (!(entry) || (!(wd = e_widget_data_get(entry))))
return;
elm_entry_select_region_set(wd->o_entry, start, end);
}
/* Private functions */
static void

@ -8,8 +8,8 @@ E_API void e_widget_entry_text_set (Evas_Object *entry, const
E_API const char *e_widget_entry_text_get (Evas_Object *entry);
E_API void e_widget_entry_clear (Evas_Object *entry);
E_API void e_widget_entry_password_set (Evas_Object *entry, int password_mode);
E_API void e_widget_entry_readonly_set (Evas_Object *entry, int readonly_mode);
E_API void e_widget_entry_readonly_set (Evas_Object *entry, int readonly_mode);
E_API void e_widget_entry_select_all (Evas_Object *entry);
E_API void e_widget_entry_select_set (Evas_Object *entry, int start, int end);
#endif
#endif

Loading…
Cancel
Save