'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"
|
#include "e_mod_main.h"
|
||||||
|
|
||||||
#define CONFIG_VERSION 2
|
#define CONFIG_VERSION 3
|
||||||
|
|
||||||
/* actual module specifics */
|
/* actual module specifics */
|
||||||
static void _e_mod_action_exebuf_cb(E_Object *obj, const char *params);
|
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_subjects, conf_item_edd);
|
||||||
E_CONFIG_LIST(D, T, conf_actions, 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_objects, conf_item_edd);
|
||||||
|
E_CONFIG_LIST(D, T, conf_views, conf_item_edd);
|
||||||
#undef T
|
#undef T
|
||||||
#undef D
|
#undef D
|
||||||
evry_conf = e_config_domain_load("module.everything", conf_edd);
|
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_subjects = NULL;
|
||||||
evry_conf->conf_actions = NULL;
|
evry_conf->conf_actions = NULL;
|
||||||
evry_conf->conf_objects = NULL;
|
evry_conf->conf_objects = NULL;
|
||||||
|
evry_conf->conf_views = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* search for plugins */
|
/* search for plugins */
|
||||||
|
|
|
@ -20,6 +20,7 @@ struct _Config
|
||||||
Eina_List *conf_subjects;
|
Eina_List *conf_subjects;
|
||||||
Eina_List *conf_actions;
|
Eina_List *conf_actions;
|
||||||
Eina_List *conf_objects;
|
Eina_List *conf_objects;
|
||||||
|
Eina_List *conf_views;
|
||||||
|
|
||||||
int scroll_animate;
|
int scroll_animate;
|
||||||
double scroll_speed;
|
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_subjects_get(const char *plugin_name);
|
||||||
static int _evry_selector_actions_get(Evry_Item *it);
|
static int _evry_selector_actions_get(Evry_Item *it);
|
||||||
static int _evry_selector_objects_get(Evry_Action *act);
|
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 int _evry_browse_item(Evry_Selector *sel);
|
||||||
static void _evry_browse_back(Evry_Selector *sel);
|
static void _evry_browse_back(Evry_Selector *sel);
|
||||||
|
@ -180,7 +180,7 @@ evry_show(E_Zone *zone, const char *params)
|
||||||
e_popup_layer_set(win->popup, 255);
|
e_popup_layer_set(win->popup, 255);
|
||||||
e_popup_show(win->popup);
|
e_popup_show(win->popup);
|
||||||
e_popup_show(list->popup);
|
e_popup_show(list->popup);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -288,8 +288,8 @@ evry_item_free(Evry_Item *it)
|
||||||
|
|
||||||
/* printf("%d, %d\t free: %s\n",
|
/* printf("%d, %d\t free: %s\n",
|
||||||
* it->ref, item_cnt - 1,
|
* it->ref, item_cnt - 1,
|
||||||
* it->label); */
|
* it->label);
|
||||||
/* item_cnt--; */
|
* item_cnt--; */
|
||||||
|
|
||||||
if (it->label) eina_stringshare_del(it->label);
|
if (it->label) eina_stringshare_del(it->label);
|
||||||
if (it->o_bg) evas_object_del(it->o_bg);
|
if (it->o_bg) evas_object_del(it->o_bg);
|
||||||
|
@ -786,10 +786,10 @@ _evry_selector_new(int type)
|
||||||
static void
|
static void
|
||||||
_evry_selector_free(Evry_Selector *sel)
|
_evry_selector_free(Evry_Selector *sel)
|
||||||
{
|
{
|
||||||
if (sel->do_thumb)
|
/* if (sel->do_thumb)
|
||||||
e_thumb_icon_end(sel->o_thumb);
|
* e_thumb_icon_end(sel->o_thumb);
|
||||||
if (sel->o_thumb)
|
* if (sel->o_thumb)
|
||||||
evas_object_del(sel->o_thumb);
|
* evas_object_del(sel->o_thumb); */
|
||||||
if (sel->o_icon)
|
if (sel->o_icon)
|
||||||
evas_object_del(sel->o_icon);
|
evas_object_del(sel->o_icon);
|
||||||
if (sel->o_main)
|
if (sel->o_main)
|
||||||
|
@ -847,55 +847,55 @@ _evry_selector_activate(Evry_Selector *sel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/* static void
|
||||||
_evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
* _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
* {
|
||||||
Evas_Coord w, h;
|
* Evas_Coord w, h;
|
||||||
Evry_Selector *sel = data;
|
* Evry_Selector *sel = data;
|
||||||
|
*
|
||||||
if (sel->o_icon)
|
* if (sel->o_icon)
|
||||||
evas_object_del(sel->o_icon);
|
* evas_object_del(sel->o_icon);
|
||||||
sel->o_icon = NULL;
|
* sel->o_icon = NULL;
|
||||||
|
*
|
||||||
e_icon_size_get(sel->o_thumb, &w, &h);
|
* e_icon_size_get(sel->o_thumb, &w, &h);
|
||||||
edje_extern_object_aspect_set(sel->o_thumb, EDJE_ASPECT_CONTROL_BOTH, 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);
|
* edje_object_part_swallow(sel->o_main, "e.swallow.thumb", sel->o_thumb);
|
||||||
evas_object_show(sel->o_thumb);
|
* evas_object_show(sel->o_thumb);
|
||||||
edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e");
|
* edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e");
|
||||||
sel->do_thumb = EINA_FALSE;
|
* sel->do_thumb = EINA_FALSE;
|
||||||
}
|
* }
|
||||||
|
*
|
||||||
static int
|
* static int
|
||||||
_evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
|
* _evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
|
||||||
{
|
* {
|
||||||
Evas_Coord w, h;
|
* Evas_Coord w, h;
|
||||||
|
*
|
||||||
if (sel->do_thumb)
|
* if (sel->do_thumb)
|
||||||
e_thumb_icon_end(sel->o_thumb);
|
* e_thumb_icon_end(sel->o_thumb);
|
||||||
|
*
|
||||||
if (sel->o_thumb)
|
* if (sel->o_thumb)
|
||||||
evas_object_del(sel->o_thumb);
|
* evas_object_del(sel->o_thumb);
|
||||||
|
*
|
||||||
if (it->plugin->type_out != thumb_types) return 0;
|
* if (it->plugin->type_out != thumb_types) return 0;
|
||||||
|
*
|
||||||
ITEM_FILE(file, it);
|
* ITEM_FILE(file, it);
|
||||||
|
*
|
||||||
if (!file->uri || !file->mime) return 0;
|
* if (!file->uri || !file->mime) return 0;
|
||||||
|
*
|
||||||
if (!strncmp(file->mime, "image/", 6))
|
* if (!strncmp(file->mime, "image/", 6))
|
||||||
{
|
* {
|
||||||
sel->o_thumb = e_thumb_icon_add(win->popup->evas);
|
* 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);
|
* 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);
|
* 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_file_set(sel->o_thumb, file->uri, NULL);
|
||||||
e_thumb_icon_size_set(sel->o_thumb, w, h);
|
* e_thumb_icon_size_set(sel->o_thumb, w, h);
|
||||||
e_thumb_icon_begin(sel->o_thumb);
|
* e_thumb_icon_begin(sel->o_thumb);
|
||||||
sel->do_thumb = EINA_TRUE;
|
* sel->do_thumb = EINA_TRUE;
|
||||||
return 1;
|
* return 1;
|
||||||
}
|
* }
|
||||||
|
*
|
||||||
return 0;
|
* return 0;
|
||||||
}
|
* } */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evry_selector_icon_set(Evry_Selector *sel)
|
_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 (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);
|
o = it->plugin->icon_get(it->plugin, it, win->popup->evas);
|
||||||
if (o)
|
if (o)
|
||||||
|
@ -929,10 +929,10 @@ _evry_selector_icon_set(Evry_Selector *sel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (it)
|
/* else if (it)
|
||||||
{
|
* {
|
||||||
_evry_selector_thumb(sel, it);
|
* _evry_selector_thumb(sel, it);
|
||||||
}
|
* } */
|
||||||
|
|
||||||
if (!sel->o_icon && s->plugin && s->plugin->icon)
|
if (!sel->o_icon && s->plugin && s->plugin->icon)
|
||||||
{
|
{
|
||||||
|
@ -1048,7 +1048,7 @@ _evry_selector_actions_get(Evry_Item *it)
|
||||||
Evry_Plugin *p, *plugin;
|
Evry_Plugin *p, *plugin;
|
||||||
Evry_Selector *sel = selectors[1];
|
Evry_Selector *sel = selectors[1];
|
||||||
const char *type_out;
|
const char *type_out;
|
||||||
|
|
||||||
while (sel->state)
|
while (sel->state)
|
||||||
_evry_state_pop(sel);
|
_evry_state_pop(sel);
|
||||||
|
|
||||||
|
@ -1193,9 +1193,6 @@ _evry_browse_item(Evry_Selector *sel)
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(sel->plugins, l, plugin)
|
EINA_LIST_FOREACH(sel->plugins, l, plugin)
|
||||||
{
|
{
|
||||||
/* if (eina_list_data_find_list(plugins, plugin))
|
|
||||||
* continue; */
|
|
||||||
|
|
||||||
if ((!plugin->begin || !plugin->type_in) ||
|
if ((!plugin->begin || !plugin->type_in) ||
|
||||||
(plugin->type_in != type_out))
|
(plugin->type_in != type_out))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -75,8 +75,9 @@ _cb_sort(const void *data1, const void *data2)
|
||||||
if (!it1->browseable && it2->browseable)
|
if (!it1->browseable && it2->browseable)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (it1->fuzzy_match - it2->fuzzy_match)
|
if (it1->fuzzy_match && it2->fuzzy_match)
|
||||||
return (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);
|
return strcasecmp(it1->label, it2->label);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ struct _View
|
||||||
Evas *evas;
|
Evas *evas;
|
||||||
const Evry_State *state;
|
const Evry_State *state;
|
||||||
Tab_View *tabs;
|
Tab_View *tabs;
|
||||||
|
|
||||||
Evas_Object *bg, *sframe, *span;
|
Evas_Object *bg, *sframe, *span;
|
||||||
int iw, ih;
|
int iw, ih;
|
||||||
};
|
};
|
||||||
|
@ -56,12 +56,12 @@ static void
|
||||||
_thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
_thumb_gen(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
Evas_Coord w, h;
|
Evas_Coord w, h;
|
||||||
Item *it = data;
|
Item *it = data;
|
||||||
|
|
||||||
if (!it->frame) return;
|
if (!it->frame) return;
|
||||||
|
|
||||||
e_icon_size_get(it->thumb, &w, &h);
|
e_icon_size_get(it->thumb, &w, &h);
|
||||||
edje_extern_object_aspect_set(it->thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
|
edje_extern_object_aspect_set(it->thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
|
||||||
edje_object_part_swallow(it->frame, "e.swallow.thumb", it->thumb);
|
edje_object_part_swallow(it->frame, "e.swallow.thumb", it->thumb);
|
||||||
evas_object_show(it->thumb);
|
evas_object_show(it->thumb);
|
||||||
it->have_thumb = EINA_TRUE;
|
it->have_thumb = EINA_TRUE;
|
||||||
|
@ -79,13 +79,13 @@ _thumb_idler(void *data)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Item *it;
|
Item *it;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(sd->items, l, it)
|
EINA_LIST_FOREACH(sd->items, l, it)
|
||||||
{
|
{
|
||||||
if (it->thumb && !(it->have_thumb || it->do_thumb))
|
if (it->thumb && !(it->have_thumb || it->do_thumb))
|
||||||
{
|
{
|
||||||
ITEM_FILE(file, it->item);
|
ITEM_FILE(file, it->item);
|
||||||
|
|
||||||
evas_object_smart_callback_add(it->thumb, "e_thumb_gen", _thumb_gen, it);
|
evas_object_smart_callback_add(it->thumb, "e_thumb_gen", _thumb_gen, it);
|
||||||
|
|
||||||
e_thumb_icon_file_set(it->thumb, file->uri, NULL);
|
e_thumb_icon_file_set(it->thumb, file->uri, NULL);
|
||||||
|
@ -104,11 +104,10 @@ _thumb_idler(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->thumb_idler = NULL;
|
sd->thumb_idler = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_e_smart_reconfigure_do(void *data)
|
_e_smart_reconfigure_do(void *data)
|
||||||
{
|
{
|
||||||
|
@ -119,7 +118,7 @@ _e_smart_reconfigure_do(void *data)
|
||||||
int iw, redo = 0, changed = 0;
|
int iw, redo = 0, changed = 0;
|
||||||
static int recursion = 0;
|
static int recursion = 0;
|
||||||
Evas_Coord x, y, xx, yy, ww, hh, mw, mh, ox, oy, dd;
|
Evas_Coord x, y, xx, yy, ww, hh, mw, mh, ox, oy, dd;
|
||||||
|
|
||||||
if (!sd) return 0;
|
if (!sd) return 0;
|
||||||
if (sd->cx > (sd->cw - sd->w)) sd->cx = sd->cw - sd->w;
|
if (sd->cx > (sd->cw - sd->w)) sd->cx = sd->cw - sd->w;
|
||||||
if (sd->cy > (sd->ch - sd->h)) sd->cy = sd->ch - sd->h;
|
if (sd->cy > (sd->ch - sd->h)) sd->cy = sd->ch - sd->h;
|
||||||
|
@ -132,10 +131,10 @@ _e_smart_reconfigure_do(void *data)
|
||||||
if (sd->zoom == 0)
|
if (sd->zoom == 0)
|
||||||
{
|
{
|
||||||
int cnt = eina_list_count(sd->items);
|
int cnt = eina_list_count(sd->items);
|
||||||
|
|
||||||
sd->view->iw *= 3;
|
sd->view->iw *= 3;
|
||||||
sd->view->iw /= 4;
|
sd->view->iw /= 4;
|
||||||
|
|
||||||
if (cnt < 3)
|
if (cnt < 3)
|
||||||
iw = (double)sd->w / 2.5;
|
iw = (double)sd->w / 2.5;
|
||||||
else if (cnt < 7)
|
else if (cnt < 7)
|
||||||
|
@ -156,12 +155,12 @@ _e_smart_reconfigure_do(void *data)
|
||||||
|
|
||||||
if (sd->view->iw <= 0) sd->view->iw = 1;
|
if (sd->view->iw <= 0) sd->view->iw = 1;
|
||||||
if (sd->view->ih <= 0) sd->view->ih = 1;
|
if (sd->view->ih <= 0) sd->view->ih = 1;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
ww = iw;
|
ww = iw;
|
||||||
hh = (sd->view->ih * iw) / (sd->view->iw);
|
hh = (sd->view->ih * iw) / (sd->view->iw);
|
||||||
|
|
||||||
mw = mh = 0;
|
mw = mh = 0;
|
||||||
EINA_LIST_FOREACH(sd->items, l, it)
|
EINA_LIST_FOREACH(sd->items, l, it)
|
||||||
{
|
{
|
||||||
|
@ -218,7 +217,7 @@ _e_smart_reconfigure_do(void *data)
|
||||||
}
|
}
|
||||||
changed = 1;
|
changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ox = 0;
|
ox = 0;
|
||||||
if (sd->w > sd->cw) ox = (sd->w - sd->cw) / 2;
|
if (sd->w > sd->cw) ox = (sd->w - sd->cw) / 2;
|
||||||
oy = 0;
|
oy = 0;
|
||||||
|
@ -226,24 +225,24 @@ _e_smart_reconfigure_do(void *data)
|
||||||
|
|
||||||
if (sd->sel_item && !sd->update)
|
if (sd->sel_item && !sd->update)
|
||||||
{
|
{
|
||||||
int y, h;
|
int y, h;
|
||||||
it = sd->sel_item;
|
it = sd->sel_item;
|
||||||
|
|
||||||
e_scrollframe_child_pos_get(sd->view->sframe, NULL, &y);
|
e_scrollframe_child_pos_get(sd->view->sframe, NULL, &y);
|
||||||
e_scrollframe_child_viewport_size_get(sd->view->sframe, NULL, &h);
|
e_scrollframe_child_viewport_size_get(sd->view->sframe, NULL, &h);
|
||||||
|
|
||||||
if ((it->y + it->h) - y > h)
|
if ((it->y + it->h) - y > h)
|
||||||
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y - (2 - sd->zoom) * it->h);
|
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y - (2 - sd->zoom) * it->h);
|
||||||
else if (it->y < y)
|
else if (it->y < y)
|
||||||
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y);
|
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_LIST_FOREACH(sd->items, l, it)
|
EINA_LIST_FOREACH(sd->items, l, it)
|
||||||
{
|
{
|
||||||
Evas_Coord dx, dy, vw, vh;
|
Evas_Coord dx, dy, vw, vh;
|
||||||
|
|
||||||
dx = dy = 0;
|
dx = dy = 0;
|
||||||
if ((sd->sx >= 0) &&
|
if ((sd->sx >= 0) &&
|
||||||
(sd->selmove > 0.0))
|
(sd->selmove > 0.0))
|
||||||
{
|
{
|
||||||
double a, d;
|
double a, d;
|
||||||
|
@ -297,7 +296,7 @@ _e_smart_reconfigure_do(void *data)
|
||||||
dy = sd->h - yy;
|
dy = sd->h - yy;
|
||||||
else
|
else
|
||||||
dy = yy;
|
dy = yy;
|
||||||
|
|
||||||
dd = dx - d;
|
dd = dx - d;
|
||||||
if (dy > dx) dd = dy - d;
|
if (dy > dx) dd = dy - d;
|
||||||
if (dd < 0) dd = 0;
|
if (dd < 0) dd = 0;
|
||||||
|
@ -307,11 +306,10 @@ _e_smart_reconfigure_do(void *data)
|
||||||
xx = sd->x - sd->cx + it->x + ox;
|
xx = sd->x - sd->cx + it->x + ox;
|
||||||
yy = sd->y - sd->cy + it->y + oy;
|
yy = sd->y - sd->cy + it->y + oy;
|
||||||
|
|
||||||
evas_object_geometry_get(sd->view->span, NULL, NULL, &vw, &vh);
|
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 (E_INTERSECTS(xx, yy, it->w, it->h, 0, - it->h*2, vw, vh + it->h*4))
|
|
||||||
{
|
{
|
||||||
if (!it->frame)
|
if (!it->visible)
|
||||||
{
|
{
|
||||||
it->frame = edje_object_add(sd->view->evas);
|
it->frame = edje_object_add(sd->view->evas);
|
||||||
|
|
||||||
|
@ -320,70 +318,69 @@ _e_smart_reconfigure_do(void *data)
|
||||||
|
|
||||||
evas_object_smart_member_add(it->frame, obj);
|
evas_object_smart_member_add(it->frame, obj);
|
||||||
evas_object_clip_set(it->frame, evas_object_clip_get(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);
|
edje_object_part_text_set(it->frame, "e.text.label", it->item->label);
|
||||||
|
|
||||||
if (!it->image && !it->have_thumb &&
|
if (!it->image && !it->have_thumb &&
|
||||||
it->item->plugin && it->item->plugin->icon_get)
|
it->item->plugin && it->item->plugin->icon_get)
|
||||||
{
|
{
|
||||||
it->image = it->item->plugin->icon_get
|
it->image = it->item->plugin->icon_get
|
||||||
(it->item->plugin, it->item, sd->view->evas);
|
(it->item->plugin, it->item, sd->view->evas);
|
||||||
|
|
||||||
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
|
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
|
||||||
evas_object_show(it->image);
|
evas_object_show(it->image);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (it->get_thumb && !it->have_thumb && !it->thumb)
|
|
||||||
{
|
|
||||||
it->thumb = e_thumb_icon_add(sd->view->evas);
|
|
||||||
|
|
||||||
if (!sd->thumb_idler)
|
evas_object_show(it->frame);
|
||||||
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");
|
||||||
|
|
||||||
|
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->selected && sd->zoom < 2)
|
if (it->visible)
|
||||||
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);
|
evas_object_move(it->frame, xx + dx, yy + dy);
|
||||||
if (it->thumb) evas_object_del(it->thumb);
|
evas_object_resize(it->frame, it->w, it->h);
|
||||||
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)
|
if (changed)
|
||||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||||
|
|
||||||
sd->update = EINA_FALSE;
|
sd->update = EINA_FALSE;
|
||||||
|
|
||||||
if (recursion == 0)
|
if (recursion == 0)
|
||||||
sd->idle_enter = NULL;
|
sd->idle_enter = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -578,7 +575,7 @@ _check_item(const Evry_Item *it)
|
||||||
|
|
||||||
if (!strncmp(file->mime, "image/", 6))
|
if (!strncmp(file->mime, "image/", 6))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -587,18 +584,18 @@ _pan_item_add(Evas_Object *obj, Evry_Item *item)
|
||||||
{
|
{
|
||||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||||
Item *it;
|
Item *it;
|
||||||
|
|
||||||
it = E_NEW(Item, 1);
|
it = E_NEW(Item, 1);
|
||||||
if (!it) return NULL;
|
if (!it) return NULL;
|
||||||
|
|
||||||
sd->items = eina_list_append(sd->items, it);
|
sd->items = eina_list_append(sd->items, it);
|
||||||
it->obj = obj;
|
it->obj = obj;
|
||||||
it->item = item;
|
it->item = item;
|
||||||
|
|
||||||
if (_check_item(item))
|
if (_check_item(item))
|
||||||
it->get_thumb = EINA_TRUE;
|
it->get_thumb = EINA_TRUE;
|
||||||
|
|
||||||
evry_item_ref(item);
|
evry_item_ref(item);
|
||||||
|
|
||||||
_e_smart_reconfigure(obj);
|
_e_smart_reconfigure(obj);
|
||||||
|
|
||||||
|
@ -617,7 +614,6 @@ _pan_item_remove(Evas_Object *obj, Item *it)
|
||||||
if (it->image) evas_object_del(it->image);
|
if (it->image) evas_object_del(it->image);
|
||||||
|
|
||||||
evry_item_free(it->item);
|
evry_item_free(it->item);
|
||||||
|
|
||||||
E_FREE(it);
|
E_FREE(it);
|
||||||
|
|
||||||
_e_smart_reconfigure(obj);
|
_e_smart_reconfigure(obj);
|
||||||
|
@ -636,9 +632,7 @@ _pan_item_select(Evas_Object *obj, Item *it)
|
||||||
if (sd->zoom < 2)
|
if (sd->zoom < 2)
|
||||||
edje_object_signal_emit(sd->sel_item->frame, "e,state,selected", "e");
|
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);
|
||||||
|
|
||||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
|
||||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, obj);
|
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)
|
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->thumb) evas_object_del(it->thumb);
|
||||||
if (it->frame) evas_object_del(it->frame);
|
if (it->frame) evas_object_del(it->frame);
|
||||||
if (it->image) evas_object_del(it->image);
|
if (it->image) evas_object_del(it->image);
|
||||||
|
@ -658,8 +653,8 @@ _view_clear(Evry_View *view)
|
||||||
E_FREE(it);
|
E_FREE(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
||||||
|
|
||||||
v->tabs->clear(v->tabs);
|
v->tabs->clear(v->tabs);
|
||||||
}
|
}
|
||||||
|
@ -669,7 +664,7 @@ _sort_cb(const void *data1, const void *data2)
|
||||||
{
|
{
|
||||||
const Item *it1 = data1;
|
const Item *it1 = data1;
|
||||||
const Item *it2 = data2;
|
const Item *it2 = data2;
|
||||||
|
|
||||||
return it1->pos - it2->pos;
|
return it1->pos - it2->pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,29 +677,30 @@ _view_update(Evry_View *view)
|
||||||
Evry_Item *p_it;
|
Evry_Item *p_it;
|
||||||
Eina_List *l, *ll, *p_items, *v_remove = NULL, *v_items = NULL;
|
Eina_List *l, *ll, *p_items, *v_remove = NULL, *v_items = NULL;
|
||||||
int pos, last_pos;
|
int pos, last_pos;
|
||||||
|
|
||||||
if (!v->state->plugin)
|
if (!v->state->plugin)
|
||||||
{
|
{
|
||||||
_view_clear(view);
|
_view_clear(view);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_items = v->state->plugin->items;
|
p_items = v->state->plugin->items;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(sd->items, l, v_it)
|
EINA_LIST_FOREACH(sd->items, l, v_it)
|
||||||
{
|
{
|
||||||
last_pos = v_it->pos;
|
last_pos = v_it->pos;
|
||||||
v_it->pos = 0;
|
v_it->pos = 0;
|
||||||
pos = 1;
|
pos = 1;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(p_items, ll, p_it)
|
EINA_LIST_FOREACH(p_items, ll, p_it)
|
||||||
{
|
{
|
||||||
if (v_it->item == p_it)
|
if (v_it->item == p_it)
|
||||||
{
|
{
|
||||||
if (pos != last_pos)
|
if (pos != last_pos)
|
||||||
v_it->changed = EINA_TRUE;
|
v_it->changed = EINA_TRUE;
|
||||||
|
|
||||||
v_it->pos = pos;
|
v_it->pos = pos;
|
||||||
|
|
||||||
if (p_it == v->state->sel_item)
|
if (p_it == v->state->sel_item)
|
||||||
{
|
{
|
||||||
sd->sel_item = v_it;
|
sd->sel_item = v_it;
|
||||||
|
@ -712,19 +708,19 @@ _view_update(Evry_View *view)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
v_it->selected = EINA_FALSE;
|
v_it->selected = EINA_FALSE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(v_it->pos)
|
if(v_it->pos)
|
||||||
{
|
{
|
||||||
v_items = eina_list_append(v_items, v_it->item);
|
v_items = eina_list_append(v_items, v_it->item);
|
||||||
if (_check_item(v_it->item))
|
if (_check_item(v_it->item))
|
||||||
v_it->get_thumb = EINA_TRUE;
|
v_it->get_thumb = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
v_remove = eina_list_append(v_remove, v_it);
|
v_remove = eina_list_append(v_remove, v_it);
|
||||||
}
|
}
|
||||||
|
@ -737,7 +733,7 @@ _view_update(Evry_View *view)
|
||||||
|
|
||||||
pos = 1;
|
pos = 1;
|
||||||
int added = 0;
|
int added = 0;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(p_items, l, p_it)
|
EINA_LIST_FOREACH(p_items, l, p_it)
|
||||||
{
|
{
|
||||||
if (!eina_list_data_find_list(v_items, p_it))
|
if (!eina_list_data_find_list(v_items, p_it))
|
||||||
|
@ -758,19 +754,18 @@ _view_update(Evry_View *view)
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->items = eina_list_sort(sd->items, pos - 1, _sort_cb);
|
|
||||||
|
|
||||||
if (added)
|
sd->items = eina_list_sort(sd->items, eina_list_count(sd->items), _sort_cb);
|
||||||
sd->update = EINA_TRUE;
|
|
||||||
|
|
||||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
if (added) sd->update = EINA_TRUE;
|
||||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
|
||||||
|
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||||
|
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
||||||
|
|
||||||
if (v_items) eina_list_free(v_items);
|
if (v_items) eina_list_free(v_items);
|
||||||
|
|
||||||
v->tabs->update(v->tabs);
|
v->tabs->update(v->tabs);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,14 +806,14 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
|
||||||
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
|
||||||
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v->tabs->key_down(v->tabs, ev))
|
if (v->tabs->key_down(v->tabs, ev))
|
||||||
{
|
{
|
||||||
_view_update(view);
|
_view_update(view);
|
||||||
|
@ -867,7 +862,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
|
||||||
|
|
||||||
if (!it && l && l->next)
|
if (!it && l && l->next)
|
||||||
it = l->next->data;
|
it = l->next->data;
|
||||||
|
|
||||||
if (it)
|
if (it)
|
||||||
{
|
{
|
||||||
_pan_item_select(v->span, it);
|
_pan_item_select(v->span, it);
|
||||||
|
@ -896,7 +891,7 @@ _cb_key_down(Evry_View *view, const Ecore_Event_Key *ev)
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -922,23 +917,23 @@ _view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow)
|
||||||
// scrolled thumbs
|
// scrolled thumbs
|
||||||
v->span = _pan_add(v->evas);
|
v->span = _pan_add(v->evas);
|
||||||
_pan_view_set(v->span, v);
|
_pan_view_set(v->span, v);
|
||||||
|
|
||||||
// the scrollframe holding the scrolled thumbs
|
// the scrollframe holding the scrolled thumbs
|
||||||
v->sframe = e_scrollframe_add(v->evas);
|
v->sframe = e_scrollframe_add(v->evas);
|
||||||
e_scrollframe_custom_theme_set(v->sframe, "base/theme/widgets",
|
e_scrollframe_custom_theme_set(v->sframe, "base/theme/widgets",
|
||||||
"e/modules/everything/thumbview/main/scrollframe");
|
"e/modules/everything/thumbview/main/scrollframe");
|
||||||
e_scrollframe_extern_pan_set(v->sframe, v->span,
|
e_scrollframe_extern_pan_set(v->sframe, v->span,
|
||||||
_pan_set, _pan_get, _pan_max_get,
|
_pan_set, _pan_get, _pan_max_get,
|
||||||
_pan_child_size_get);
|
_pan_child_size_get);
|
||||||
edje_object_part_swallow(v->bg, "e.swallow.list", v->sframe);
|
edje_object_part_swallow(v->bg, "e.swallow.list", v->sframe);
|
||||||
evas_object_show(v->sframe);
|
evas_object_show(v->sframe);
|
||||||
evas_object_show(v->span);
|
evas_object_show(v->span);
|
||||||
|
|
||||||
EVRY_VIEW(v)->o_list = v->bg;
|
EVRY_VIEW(v)->o_list = v->bg;
|
||||||
|
|
||||||
v->tabs = evry_tab_view_new(s, v->evas);
|
v->tabs = evry_tab_view_new(s, v->evas);
|
||||||
v->view.o_bar = v->tabs->o_tabs;
|
v->view.o_bar = v->tabs->o_tabs;
|
||||||
|
|
||||||
return EVRY_VIEW(v);
|
return EVRY_VIEW(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,13 +941,13 @@ static void
|
||||||
_view_destroy(Evry_View *view)
|
_view_destroy(Evry_View *view)
|
||||||
{
|
{
|
||||||
VIEW(v, view);
|
VIEW(v, view);
|
||||||
|
|
||||||
evas_object_del(v->bg);
|
evas_object_del(v->bg);
|
||||||
evas_object_del(v->sframe);
|
evas_object_del(v->sframe);
|
||||||
evas_object_del(v->span);
|
evas_object_del(v->span);
|
||||||
|
|
||||||
evry_tab_view_free(v->tabs);
|
evry_tab_view_free(v->tabs);
|
||||||
|
|
||||||
E_FREE(v);
|
E_FREE(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue