'everything' module: disable thumb nails for selector
- there is a bug somewhere.. i guess it's e_thumb not liking to have the same file twice to thumbnail - cleanups for thumb view SVN revision: 42003
This commit is contained in:
parent
3bda6d6735
commit
82745eb2a6
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#define CONFIG_VERSION 2
|
||||
#define CONFIG_VERSION 3
|
||||
|
||||
/* actual module specifics */
|
||||
static void _e_mod_action_exebuf_cb(E_Object *obj, const char *params);
|
||||
|
@ -83,6 +83,7 @@ e_modapi_init(E_Module *m)
|
|||
E_CONFIG_LIST(D, T, conf_subjects, conf_item_edd);
|
||||
E_CONFIG_LIST(D, T, conf_actions, conf_item_edd);
|
||||
E_CONFIG_LIST(D, T, conf_objects, conf_item_edd);
|
||||
E_CONFIG_LIST(D, T, conf_views, conf_item_edd);
|
||||
#undef T
|
||||
#undef D
|
||||
evry_conf = e_config_domain_load("module.everything", conf_edd);
|
||||
|
@ -103,6 +104,7 @@ e_modapi_init(E_Module *m)
|
|||
evry_conf->conf_subjects = NULL;
|
||||
evry_conf->conf_actions = NULL;
|
||||
evry_conf->conf_objects = NULL;
|
||||
evry_conf->conf_views = NULL;
|
||||
}
|
||||
|
||||
/* search for plugins */
|
||||
|
|
|
@ -20,6 +20,7 @@ struct _Config
|
|||
Eina_List *conf_subjects;
|
||||
Eina_List *conf_actions;
|
||||
Eina_List *conf_objects;
|
||||
Eina_List *conf_views;
|
||||
|
||||
int scroll_animate;
|
||||
double scroll_speed;
|
||||
|
|
|
@ -58,7 +58,7 @@ static void _evry_selector_icon_set(Evry_Selector *sel);
|
|||
static int _evry_selector_subjects_get(const char *plugin_name);
|
||||
static int _evry_selector_actions_get(Evry_Item *it);
|
||||
static int _evry_selector_objects_get(Evry_Action *act);
|
||||
static void _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info);
|
||||
/* static void _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info); */
|
||||
|
||||
static int _evry_browse_item(Evry_Selector *sel);
|
||||
static void _evry_browse_back(Evry_Selector *sel);
|
||||
|
@ -288,8 +288,8 @@ evry_item_free(Evry_Item *it)
|
|||
|
||||
/* printf("%d, %d\t free: %s\n",
|
||||
* it->ref, item_cnt - 1,
|
||||
* it->label); */
|
||||
/* item_cnt--; */
|
||||
* it->label);
|
||||
* item_cnt--; */
|
||||
|
||||
if (it->label) eina_stringshare_del(it->label);
|
||||
if (it->o_bg) evas_object_del(it->o_bg);
|
||||
|
@ -786,10 +786,10 @@ _evry_selector_new(int type)
|
|||
static void
|
||||
_evry_selector_free(Evry_Selector *sel)
|
||||
{
|
||||
if (sel->do_thumb)
|
||||
e_thumb_icon_end(sel->o_thumb);
|
||||
if (sel->o_thumb)
|
||||
evas_object_del(sel->o_thumb);
|
||||
/* if (sel->do_thumb)
|
||||
* e_thumb_icon_end(sel->o_thumb);
|
||||
* if (sel->o_thumb)
|
||||
* evas_object_del(sel->o_thumb); */
|
||||
if (sel->o_icon)
|
||||
evas_object_del(sel->o_icon);
|
||||
if (sel->o_main)
|
||||
|
@ -847,55 +847,55 @@ _evry_selector_activate(Evry_Selector *sel)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
Evry_Selector *sel = data;
|
||||
|
||||
if (sel->o_icon)
|
||||
evas_object_del(sel->o_icon);
|
||||
sel->o_icon = NULL;
|
||||
|
||||
e_icon_size_get(sel->o_thumb, &w, &h);
|
||||
edje_extern_object_aspect_set(sel->o_thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
|
||||
edje_object_part_swallow(sel->o_main, "e.swallow.thumb", sel->o_thumb);
|
||||
evas_object_show(sel->o_thumb);
|
||||
edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e");
|
||||
sel->do_thumb = EINA_FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
_evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
|
||||
if (sel->do_thumb)
|
||||
e_thumb_icon_end(sel->o_thumb);
|
||||
|
||||
if (sel->o_thumb)
|
||||
evas_object_del(sel->o_thumb);
|
||||
|
||||
if (it->plugin->type_out != thumb_types) return 0;
|
||||
|
||||
ITEM_FILE(file, it);
|
||||
|
||||
if (!file->uri || !file->mime) return 0;
|
||||
|
||||
if (!strncmp(file->mime, "image/", 6))
|
||||
{
|
||||
sel->o_thumb = e_thumb_icon_add(win->popup->evas);
|
||||
evas_object_smart_callback_add(sel->o_thumb, "e_thumb_gen", _evry_selector_thumb_gen, sel);
|
||||
edje_object_part_geometry_get(sel->o_main, "e.swallow.thumb", NULL, NULL, &w, &h);
|
||||
e_thumb_icon_file_set(sel->o_thumb, file->uri, NULL);
|
||||
e_thumb_icon_size_set(sel->o_thumb, w, h);
|
||||
e_thumb_icon_begin(sel->o_thumb);
|
||||
sel->do_thumb = EINA_TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* static void
|
||||
* _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
||||
* {
|
||||
* Evas_Coord w, h;
|
||||
* Evry_Selector *sel = data;
|
||||
*
|
||||
* if (sel->o_icon)
|
||||
* evas_object_del(sel->o_icon);
|
||||
* sel->o_icon = NULL;
|
||||
*
|
||||
* e_icon_size_get(sel->o_thumb, &w, &h);
|
||||
* edje_extern_object_aspect_set(sel->o_thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
|
||||
* edje_object_part_swallow(sel->o_main, "e.swallow.thumb", sel->o_thumb);
|
||||
* evas_object_show(sel->o_thumb);
|
||||
* edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e");
|
||||
* sel->do_thumb = EINA_FALSE;
|
||||
* }
|
||||
*
|
||||
* static int
|
||||
* _evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
|
||||
* {
|
||||
* Evas_Coord w, h;
|
||||
*
|
||||
* if (sel->do_thumb)
|
||||
* e_thumb_icon_end(sel->o_thumb);
|
||||
*
|
||||
* if (sel->o_thumb)
|
||||
* evas_object_del(sel->o_thumb);
|
||||
*
|
||||
* if (it->plugin->type_out != thumb_types) return 0;
|
||||
*
|
||||
* ITEM_FILE(file, it);
|
||||
*
|
||||
* if (!file->uri || !file->mime) return 0;
|
||||
*
|
||||
* if (!strncmp(file->mime, "image/", 6))
|
||||
* {
|
||||
* sel->o_thumb = e_thumb_icon_add(win->popup->evas);
|
||||
* evas_object_smart_callback_add(sel->o_thumb, "e_thumb_gen", _evry_selector_thumb_gen, sel);
|
||||
* edje_object_part_geometry_get(sel->o_main, "e.swallow.thumb", NULL, NULL, &w, &h);
|
||||
* e_thumb_icon_file_set(sel->o_thumb, file->uri, NULL);
|
||||
* e_thumb_icon_size_set(sel->o_thumb, w, h);
|
||||
* e_thumb_icon_begin(sel->o_thumb);
|
||||
* sel->do_thumb = EINA_TRUE;
|
||||
* return 1;
|
||||
* }
|
||||
*
|
||||
* return 0;
|
||||
* } */
|
||||
|
||||
static void
|
||||
_evry_selector_icon_set(Evry_Selector *sel)
|
||||
|
@ -918,7 +918,7 @@ _evry_selector_icon_set(Evry_Selector *sel)
|
|||
|
||||
if (it && it->plugin && it->plugin->icon_get)
|
||||
{
|
||||
if (!_evry_selector_thumb(sel, it))
|
||||
if (1) //!_evry_selector_thumb(sel, it))
|
||||
{
|
||||
o = it->plugin->icon_get(it->plugin, it, win->popup->evas);
|
||||
if (o)
|
||||
|
@ -929,10 +929,10 @@ _evry_selector_icon_set(Evry_Selector *sel)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (it)
|
||||
{
|
||||
_evry_selector_thumb(sel, it);
|
||||
}
|
||||
/* else if (it)
|
||||
* {
|
||||
* _evry_selector_thumb(sel, it);
|
||||
* } */
|
||||
|
||||
if (!sel->o_icon && s->plugin && s->plugin->icon)
|
||||
{
|
||||
|
@ -1193,9 +1193,6 @@ _evry_browse_item(Evry_Selector *sel)
|
|||
{
|
||||
EINA_LIST_FOREACH(sel->plugins, l, plugin)
|
||||
{
|
||||
/* if (eina_list_data_find_list(plugins, plugin))
|
||||
* continue; */
|
||||
|
||||
if ((!plugin->begin || !plugin->type_in) ||
|
||||
(plugin->type_in != type_out))
|
||||
continue;
|
||||
|
|
|
@ -75,8 +75,9 @@ _cb_sort(const void *data1, const void *data2)
|
|||
if (!it1->browseable && it2->browseable)
|
||||
return 1;
|
||||
|
||||
if (it1->fuzzy_match - it2->fuzzy_match)
|
||||
return (it1->fuzzy_match - it2->fuzzy_match);
|
||||
if (it1->fuzzy_match && it2->fuzzy_match)
|
||||
if (it1->fuzzy_match - it2->fuzzy_match)
|
||||
return (it1->fuzzy_match - it2->fuzzy_match);
|
||||
|
||||
return strcasecmp(it1->label, it2->label);
|
||||
}
|
||||
|
|
|
@ -108,7 +108,6 @@ _thumb_idler(void *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
_e_smart_reconfigure_do(void *data)
|
||||
{
|
||||
|
@ -307,11 +306,10 @@ _e_smart_reconfigure_do(void *data)
|
|||
xx = sd->x - sd->cx + it->x + ox;
|
||||
yy = sd->y - sd->cy + it->y + oy;
|
||||
|
||||
evas_object_geometry_get(sd->view->span, NULL, NULL, &vw, &vh);
|
||||
|
||||
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, - it->h*2, vw, vh + it->h*4))
|
||||
evas_output_viewport_get(evas_object_evas_get(obj), NULL, NULL, &vw, &vh);
|
||||
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, 0, vw, vh))
|
||||
{
|
||||
if (!it->frame)
|
||||
if (!it->visible)
|
||||
{
|
||||
it->frame = edje_object_add(sd->view->evas);
|
||||
|
||||
|
@ -320,6 +318,7 @@ _e_smart_reconfigure_do(void *data)
|
|||
|
||||
evas_object_smart_member_add(it->frame, obj);
|
||||
evas_object_clip_set(it->frame, evas_object_clip_get(obj));
|
||||
|
||||
edje_object_part_text_set(it->frame, "e.text.label", it->item->label);
|
||||
|
||||
if (!it->image && !it->have_thumb &&
|
||||
|
@ -331,52 +330,50 @@ _e_smart_reconfigure_do(void *data)
|
|||
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
|
||||
evas_object_show(it->image);
|
||||
}
|
||||
|
||||
evas_object_show(it->frame);
|
||||
|
||||
if (it->selected && sd->zoom < 2)
|
||||
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
||||
|
||||
if (sd->update && !it->visible)
|
||||
edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e");
|
||||
else if (!it->visible)
|
||||
edje_object_signal_emit(it->frame, "e,action,thumb,show", "e");
|
||||
|
||||
if (it->get_thumb)
|
||||
{
|
||||
it->thumb = e_thumb_icon_add(sd->view->evas);
|
||||
|
||||
if (!sd->thumb_idler)
|
||||
sd->thumb_idler = ecore_idle_enterer_before_add(_thumb_idler, sd);
|
||||
}
|
||||
it->visible = EINA_TRUE;
|
||||
}
|
||||
|
||||
if (it->get_thumb && !it->have_thumb && !it->thumb)
|
||||
if (it->visible)
|
||||
{
|
||||
it->thumb = e_thumb_icon_add(sd->view->evas);
|
||||
evas_object_move(it->frame, xx + dx, yy + dy);
|
||||
evas_object_resize(it->frame, it->w, it->h);
|
||||
|
||||
if (!sd->thumb_idler)
|
||||
sd->thumb_idler = ecore_idle_enterer_before_add(_thumb_idler, sd);
|
||||
}
|
||||
|
||||
if (it->selected && sd->zoom < 2)
|
||||
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
||||
|
||||
if (sd->update && !it->visible)
|
||||
edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e");
|
||||
else if (!it->visible)
|
||||
edje_object_signal_emit(it->frame, "e,action,thumb,show", "e");
|
||||
|
||||
evas_object_move(it->frame,
|
||||
xx + dx,
|
||||
yy + dy);
|
||||
|
||||
evas_object_resize(it->frame, it->w, it->h);
|
||||
evas_object_show(it->frame);
|
||||
it->visible = EINA_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (it->frame)
|
||||
{
|
||||
if (it->do_thumb) e_thumb_icon_end(it->thumb);
|
||||
if (it->thumb) evas_object_del(it->thumb);
|
||||
if (it->image) evas_object_del(it->image);
|
||||
|
||||
evas_object_del(it->frame);
|
||||
|
||||
it->thumb = NULL;
|
||||
it->image = NULL;
|
||||
it->frame = NULL;
|
||||
|
||||
it->have_thumb = EINA_FALSE;
|
||||
it->do_thumb = EINA_FALSE;
|
||||
it->visible = EINA_FALSE;
|
||||
it->changed = TRUE;
|
||||
}
|
||||
}
|
||||
else if (it->visible)
|
||||
{
|
||||
if (it->do_thumb) e_thumb_icon_end(it->thumb);
|
||||
if (it->thumb) evas_object_del(it->thumb);
|
||||
if (it->image) evas_object_del(it->image);
|
||||
if (it->frame) evas_object_del(it->frame);
|
||||
|
||||
it->thumb = NULL;
|
||||
it->image = NULL;
|
||||
it->frame = NULL;
|
||||
|
||||
it->have_thumb = EINA_FALSE;
|
||||
it->do_thumb = EINA_FALSE;
|
||||
it->visible = EINA_FALSE;
|
||||
it->changed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (changed)
|
||||
|
@ -617,7 +614,6 @@ _pan_item_remove(Evas_Object *obj, Item *it)
|
|||
if (it->image) evas_object_del(it->image);
|
||||
|
||||
evry_item_free(it->item);
|
||||
|
||||
E_FREE(it);
|
||||
|
||||
_e_smart_reconfigure(obj);
|
||||
|
@ -636,8 +632,6 @@ _pan_item_select(Evas_Object *obj, Item *it)
|
|||
if (sd->zoom < 2)
|
||||
edje_object_signal_emit(sd->sel_item->frame, "e,state,selected", "e");
|
||||
|
||||
/* sd->update = EINA_FALSE; */
|
||||
|
||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, obj);
|
||||
}
|
||||
|
@ -651,6 +645,7 @@ _view_clear(Evry_View *view)
|
|||
|
||||
EINA_LIST_FREE(sd->items, it)
|
||||
{
|
||||
if (it->do_thumb) e_thumb_icon_end(it->thumb);
|
||||
if (it->thumb) evas_object_del(it->thumb);
|
||||
if (it->frame) evas_object_del(it->frame);
|
||||
if (it->image) evas_object_del(it->image);
|
||||
|
@ -694,8 +689,9 @@ _view_update(Evry_View *view)
|
|||
EINA_LIST_FOREACH(sd->items, l, v_it)
|
||||
{
|
||||
last_pos = v_it->pos;
|
||||
v_it->pos = 0;
|
||||
v_it->pos = 0;
|
||||
pos = 1;
|
||||
|
||||
EINA_LIST_FOREACH(p_items, ll, p_it)
|
||||
{
|
||||
if (v_it->item == p_it)
|
||||
|
@ -759,10 +755,9 @@ _view_update(Evry_View *view)
|
|||
pos++;
|
||||
}
|
||||
|
||||
sd->items = eina_list_sort(sd->items, pos - 1, _sort_cb);
|
||||
sd->items = eina_list_sort(sd->items, eina_list_count(sd->items), _sort_cb);
|
||||
|
||||
if (added)
|
||||
sd->update = EINA_TRUE;
|
||||
if (added) sd->update = EINA_TRUE;
|
||||
|
||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
||||
|
|
Loading…
Reference in New Issue