/* #undef DBG
* #define DBG(...) ERR(__VA_ARGS__) */
-#define CONFIG_VERSION 7
+#define CONFIG_VERSION 8
/* actual module specifics */
static void _e_mod_action_cb(E_Object *obj, const char *params);
#undef T
#undef D
evry_conf = e_config_domain_load("module.everything", conf_edd);
-
+
+ if (evry_conf && evry_conf->version == 7)
+ {
+ evry_conf->scroll_speed = 10.0;
+ evry_conf->version = CONFIG_VERSION;
+ }
+
if (evry_conf && evry_conf->version != CONFIG_VERSION)
{
_config_free();
evry_conf->width = 0;
evry_conf->height = 0;
evry_conf->scroll_animate = 0;
- evry_conf->scroll_speed = 0.08;
+ evry_conf->scroll_speed = 10.0;
evry_conf->hide_input = 0;
evry_conf->hide_list = 0;
evry_conf->quick_nav = 1;
int width, height;
double rel_x, rel_y;
int scroll_animate;
-
+ double scroll_speed;
+
char *cmd_terminal;
char *cmd_sudo;
C(view_zoom);
C(cycle_mode);
C(history_sort_mode);
+ C(scroll_animate);
+ C(scroll_speed);
#undef C
EINA_LIST_FOREACH(evry_conf->plugins, l, p)
C(view_zoom);
C(cycle_mode);
C(history_sort_mode);
+ C(scroll_animate);
+ C(scroll_speed);
#undef C
evry_conf->plugins = eina_list_sort(evry_conf->plugins, -1,
ob = e_widget_radio_add(evas, "Icons", 1, rg);
e_widget_radio_toggle_set(ob, (cfdata->view_mode == 1));
e_widget_framelist_object_append(of, ob);
+
+ ob = e_widget_check_add(evas, _("Animate scrolling"),
+ &(cfdata->scroll_animate));
+ e_widget_framelist_object_append(of, ob);
+ ob = e_widget_slider_add(evas, 1, 0, _("%1.1f"),
+ 5, 20, 0.1, 0, &(cfdata->scroll_speed), NULL, 10);
+ e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Up/Down select next item in icon view"),
&(cfdata->cycle_mode));
Ecore_Idle_Enterer *idle_enter;
Ecore_Idle_Enterer *thumb_idler;
Ecore_Idle_Enterer *update_idler;
- Ecore_Animator *animator;
Evas_Coord x, y, w, h;
Evas_Coord cx, cy, cw, ch;
Evas_Coord sx, sy;
Eina_Bool update : 1;
Eina_Bool switch_mode : 1;
Eina_List *queue;
+
+ double scroll_align;
+ double scroll_align_to;
+ int scroll_to;
+ Ecore_Animator *animator;
};
struct _Item
edje_object_signal_emit(it->frame, "e,state,browseable", "e");
it->visible = EINA_TRUE;
+
+ if (it->selected)
+ edje_object_signal_emit(it->frame, "e,state,selected", "e");
}
if (!eina_list_data_find(sd->queue, it))
evas_object_move(it->frame, xx, yy);
evas_object_resize(it->frame, it->w, it->h);
+
/* if (sd->update || it->changed)
* {
- * if (it->selected && sd->view->zoom < 2)
+ * if (it->selected)
* edje_object_signal_emit(it->frame, "e,state,selected", "e");
* else
* edje_object_signal_emit(it->frame, "e,state,unselected", "e");
ecore_idle_enterer_del(sd->idle_enter);
if (sd->thumb_idler)
ecore_idle_enterer_del(sd->thumb_idler);
-
+ if (sd->animator)
+ ecore_animator_del(sd->animator);
+
// sd->view is just referenced
// sd->child_obj is unused
EINA_LIST_FREE(sd->items, it)
_e_smart_reconfigure(obj);
}
+static int
+_animator(void *data)
+{
+ Smart_Data *sd = data;
+
+ if (sd->scroll_to)
+ {
+ double da;
+
+ double spd = 10.0 / e_config->framerate;
+
+ sd->scroll_align = (sd->scroll_align * (1.0 - spd)) + (sd->scroll_align_to * spd);
+
+ da = sd->scroll_align - sd->scroll_align_to;
+ if (da < 0.0) da = -da;
+ if (da < 0.01)
+ {
+ sd->scroll_align = sd->scroll_align_to;
+ sd->scroll_to = 0;
+ }
+ e_scrollframe_child_pos_set(sd->view->sframe, 0, sd->scroll_align);
+
+ /* e_box_align_set(eap_list_object, 0.5, eap_scroll_align); */
+ }
+ if (sd->scroll_to) return 1;
+ sd->animator = NULL;
+ return 0;
+}
+
static void
_pan_item_select(Evas_Object *obj, Item *it)
{
Smart_Data *sd = evas_object_smart_data_get(obj);
- int align = -1;
+ double align = -1;
if (sd->cur_item)
{
else if (it->y < sd->cy)
align = it->y;
+ e_scrollframe_child_pos_get(sd->view->sframe, 0, (Evas_Coord *)&sd->scroll_align);
+
if (align >= 0)
- e_scrollframe_child_pos_set(sd->view->sframe, 0, align);
-
+ {
+ if (!evry_conf->scroll_animate)
+ {
+ if (align >= 0)
+ e_scrollframe_child_pos_set(sd->view->sframe, 0, align);
+ }
+ else
+ {
+ sd->scroll_align_to = align;
+ sd->scroll_to = 1;
+ if (!sd->animator)
+ sd->animator = ecore_animator_add(_animator, sd);
+ }
+ }
+
if (sd->view->zoom < 2)
edje_object_signal_emit(sd->cur_item->frame, "e,state,selected", "e");
Eina_List *l;
Item *it;
+ if (sd->animator)
+ ecore_animator_del(sd->animator);
+ sd->animator = NULL;
+
EINA_LIST_FOREACH(sd->items, l, it)
{
if (it->do_thumb)
_update_frame(Evas_Object *obj)
{
Smart_Data *sd = evas_object_smart_data_get(obj);
- //sd->switch_mode = EINA_TRUE;
+ /* sd->switch_mode = EINA_TRUE; */
_e_smart_reconfigure_do(obj);
- //sd->switch_mode = EINA_FALSE;
+ /* sd->switch_mode = EINA_FALSE; */
+ int tmp = evry_conf->scroll_animate;
+ evry_conf->scroll_animate = 0;
_pan_item_select(obj, sd->cur_item);
-
+ evry_conf->scroll_animate = tmp;
return 0;
}
VIEW(v, view);
Ecore_Event_Handler *h;
-
+
evas_object_del(v->bg);
evas_object_del(v->sframe);
evas_object_del(v->span);