From 63bc52c2b6d4b46f6223c655ba3080a37a198d49 Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Mon, 24 May 2010 11:49:46 +0000 Subject: [PATCH] - set it->icon automatically when icon is in theme or full path, no need for icon_get func - keep current view when browsing - theme tweaks SVN revision: 49179 --- data/themes/default.edc | 107 ++++++------------ src/modules/everything/e_mod_main.c | 2 +- src/modules/everything/evry_plug_view_thumb.c | 65 +++++++---- src/modules/everything/evry_util.c | 20 +++- 4 files changed, 95 insertions(+), 99 deletions(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index 42cdb466d..f7992a312 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -32886,8 +32886,9 @@ collections { to_y: "input_base"; } rel2 { - to_x: "list_frame"; - to_y: "input_base"; + /* to: "list_frame"; */ + to_x: "list_frame"; + to_y: "input_base"; } } description { @@ -33521,7 +33522,7 @@ collections { signal: "e,state,list_show"; source: "e"; action: STATE_SET "visible" 0.0; - transition: DECELERATE 0.1; + transition: ACCELERATE 0.05; target: "base"; target: "shadow_clip"; } @@ -33539,7 +33540,7 @@ collections { signal: "e,state,entry_show"; source: "e"; action: STATE_SET "visible" 0.0; - transition: SINUSOIDAL 0.08; + transition: SINUSOIDAL 0.03; target: "input_over1"; target: "input_over2"; target: "input_base"; @@ -33976,7 +33977,7 @@ collections { align: 0.0 0.5; min: 32 32; max: 32 32; - color: 255 255 255 0; + color: 255 255 255 0; } description { state: "visible" 0.0; @@ -33998,7 +33999,7 @@ collections { align: 1.0 0.5; min: 32 32; max: 32 32; - color: 255 255 255 0; + color: 255 255 255 0; } description { state: "visible" 0.0; @@ -34109,7 +34110,7 @@ collections { type: RECT; description { state: "default" 0.0; - visible: 0; + /* visible: 0; */ rel1 { relative: 0.0 0.0; offset: 0 4; @@ -34118,7 +34119,7 @@ collections { relative: 1.0 1.0; offset: -5 -5; } - color: 255 255 255 0; + color: 255 255 255 128; } description { state: "visible" 0.0; @@ -34136,12 +34137,7 @@ collections { state: "default" 0.0; rel1.to: "base"; rel2.to: "base"; - color: 235 235 235 255; - } - description { - state: "selected" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + color: 225 225 225 255; } } part { @@ -34182,7 +34178,7 @@ collections { } } } - part { + part { name: "arrow"; mouse_events: 0; description { @@ -34191,7 +34187,7 @@ collections { max: 12 12; /* aspect_preference: */ visible: 0; - align: 1.0 0.0; + align: 1.0 0.0; rel1 { to: "base"; relative: 1.0 0.0; @@ -34277,50 +34273,35 @@ collections { transition: LINEAR 0.2; target: "bg_mark"; } - program { + program { name: "arrow_show"; signal: "e,state,browseable"; source: "e"; action: STATE_SET "visible" 0.0; target: "arrow"; } - program { - name: "thumb_gen"; - signal: "e,action,thumb,gen"; - source: "e"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.0; - target: "base"; - after: "thumb_ungen"; - } - program { - name: "thumb_ungen"; - signal: "e,action,thumb,ungen"; - source: "e"; - action: STATE_SET "visible" 0.0; - transition: SINUSOIDAL 0.15; - target: "base"; - } program { name: "thumb_show_delayed"; signal: "e,action,thumb,show_delayed"; source: "e"; action: STATE_SET "default" 0.0; target: "base"; - after: "thumb_show_delayed2"; - } - program { - name: "thumb_show_delayed2"; - action: STATE_SET "visible" 0.0; - transition: SINUSOIDAL 0.3; - target: "base"; + transition: DECELERATE 0.08; + after: "thumb_show2"; } program { name: "thumb_show"; signal: "e,action,thumb,show"; source: "e"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.02; + target: "base"; + after: "thumb_show2"; + } + program { + name: "thumb_show2"; action: STATE_SET "visible" 0.0; - transition: SINUSOIDAL 0.1; + transition: ACCELERATE 0.05; target: "base"; } } @@ -34393,7 +34374,7 @@ collections { type: RECT; description { state: "default" 0.0; - visible: 0; + /* visible: 0; */ rel1 { relative: 0.0 0.0; offset: 0 3; @@ -34428,12 +34409,7 @@ collections { relative: 0.0 1.0; offset: 40 -1; } - color: 235 235 235 255; - } - description { - state: "selected" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; + color: 225 225 225 255; } } part { @@ -34644,40 +34620,20 @@ collections { action: STATE_SET "visible" 0.0; target: "arrow"; } - program { - name: "thumb_gen"; - signal: "e,action,thumb,gen"; - source: "e"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.0; - target: "base"; - after: "thumb_ungen"; - } - program { - name: "thumb_ungen"; - signal: "e,action,thumb,ungen"; - source: "e"; - action: STATE_SET "visible" 0.0; - target: "base"; - } program { name: "thumb_show_delayed"; signal: "e,action,thumb,show_delayed"; source: "e"; - action: STATE_SET "default" 0.0; - target: "base"; - after: "thumb_show_delayed2"; - } - program { - name: "thumb_show_delayed2"; action: STATE_SET "visible" 0.0; target: "base"; + transition: ACCELERATE 0.02; } program { name: "thumb_show"; signal: "e,action,thumb,show"; source: "e"; action: STATE_SET "visible" 0.0; + transition: ACCELERATE 0.0; target: "base"; } program { @@ -34685,16 +34641,17 @@ collections { signal: "e,state,detail,show"; source: "e"; action: STATE_SET "detail" 0.0; - target: "e.text.label"; - target: "e.text.detail"; + transition: ACCELERATE 0.06; + target: "e.text.label"; + target: "e.text.detail"; } program { name: "detail_hide"; signal: "e,state,detail,hide"; source: "e"; action: STATE_SET "default" 0.0; - target: "e.text.label"; - target: "e.text.detail"; + target: "e.text.label"; + target: "e.text.detail"; } } } diff --git a/src/modules/everything/e_mod_main.c b/src/modules/everything/e_mod_main.c index c2ea34dc8..9039e493b 100644 --- a/src/modules/everything/e_mod_main.c +++ b/src/modules/everything/e_mod_main.c @@ -387,7 +387,7 @@ _config_init() IFMODCFG(0x0001); evry_conf->rel_x = 0.5; evry_conf->rel_y = 0.33; - evry_conf->width = 435; + evry_conf->width = 450; evry_conf->height = 415; evry_conf->scroll_animate = 1; evry_conf->scroll_speed = 10.0; diff --git a/src/modules/everything/evry_plug_view_thumb.c b/src/modules/everything/evry_plug_view_thumb.c index 670ecac3c..f29a82be0 100644 --- a/src/modules/everything/evry_plug_view_thumb.c +++ b/src/modules/everything/evry_plug_view_thumb.c @@ -103,6 +103,8 @@ _thumb_gen(void *data, Evas_Object *obj, void *event_info) edje_extern_object_aspect_set(it->thumb, EDJE_ASPECT_CONTROL_BOTH, w, h); edje_object_part_swallow(it->frame, "e.swallow.thumb", it->thumb); evas_object_show(it->thumb); + edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e"); + edje_object_message_signal_process(it->frame); it->have_thumb = EINA_TRUE; it->do_thumb = EINA_FALSE; @@ -129,6 +131,13 @@ _check_item(const Evry_Item *it) return 0; } +static int _sort_pos_cb(const void *d1, const void *d2) +{ + const Item *it1 = d1; + const Item *it2 = d2; + return ((it1->x + it1->y * 4) - (it2->x + it2->y * 4)); +} + static int _thumb_idler(void *data) { @@ -136,10 +145,13 @@ _thumb_idler(void *data) Eina_List *l, *ll; Item *it; char *suffix; - + int w, h; + if (!sd || sd->clearing) return 1; + sd->queue = eina_list_sort(sd->queue, -1, _sort_pos_cb); + EINA_LIST_FOREACH_SAFE(sd->queue, l, ll, it) { if (!it->image && !it->have_thumb) @@ -148,6 +160,10 @@ _thumb_idler(void *data) if (it->image) { + e_icon_size_get(it->image, &w, &h); + if (w && h) + edje_extern_object_aspect_set(it->thumb, EDJE_ASPECT_CONTROL_BOTH, w, h); + edje_object_part_swallow(it->frame, "e.swallow.icon", it->image); evas_object_show(it->image); } @@ -177,7 +193,16 @@ _thumb_idler(void *data) e_thumb_icon_size_set(it->thumb, it->w, it->h); e_thumb_icon_begin(it->thumb); it->do_thumb = EINA_TRUE; + + if (it->image) + edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e"); } + else + { + edje_object_signal_emit(it->frame, "e,action,thumb,show", "e"); + } + + e_util_wakeup(); sd->queue = eina_list_remove_list(sd->queue, l); return 1; @@ -296,10 +321,9 @@ _item_show(View *v, Item *it, Evas_Object *list) evas_object_show(it->frame); - if (it->changed) - edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e"); - else - edje_object_signal_emit(it->frame, "e,action,thumb,show", "e"); + /* if (it->changed) + * edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e"); + * else */ if (it->item->browseable) edje_object_signal_emit(it->frame, "e,state,browseable", "e"); @@ -1073,19 +1097,14 @@ _view_update(Evry_View *view, int slide) if (p != v->plugin) { - if (p->config->view_mode >= 0) + if (p->config->view_mode != v->mode) { - if (p->config->view_mode != v->mode) - _clear_items(v->span); + _clear_items(v->span); - v->mode = p->config->view_mode; - } - else - { - if (v->mode_prev != v->mode) - _clear_items(v->span); - - v->mode = v->mode_prev; + if (p->config->view_mode < 0) + v->mode = evry_conf->view_mode; + else + v->mode = p->config->view_mode; } } @@ -1610,7 +1629,7 @@ _view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow) View *v; Ecore_Event_Handler *h; - + if (!s->plugin) return NULL; @@ -1619,11 +1638,17 @@ _view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow) v->state = s; v->evas = evas_object_evas_get(swallow); - if (parent->mode < 0) - v->mode = evry_conf->view_mode; - else + if ((s->selector->states->next) && + ((s->plugin->config->view_mode < 0) || + (!strcmp(s->plugin->name, N_("All"))))) v->mode = parent->mode; + else if (s->plugin->config->view_mode >= 0) + v->mode = s->plugin->config->view_mode; + else + v->mode = evry_conf->view_mode; + v->plugin = s->plugin; + v->mode_prev = v->mode; v->zoom = parent->zoom; diff --git a/src/modules/everything/evry_util.c b/src/modules/everything/evry_util.c index cabbd48e4..39cff0b01 100644 --- a/src/modules/everything/evry_util.c +++ b/src/modules/everything/evry_util.c @@ -434,6 +434,7 @@ Evas_Object * evry_icon_theme_get(const char *icon, Evas *e) { Evas_Object *o = e_icon_add(e); + e_icon_preload_set(o, 1); if (e_config->icon_theme_overrides) { @@ -510,10 +511,11 @@ _file_icon_get(Evry_Item *it, Evas *e) if (it->icon) { - o = e_icon_add(e); - if (it->icon[0] == '/') { + o = e_icon_add(e); + e_icon_preload_set(o, 1); + if (!e_icon_file_set(o, it->icon)) { evas_object_del(o); @@ -527,7 +529,7 @@ _file_icon_get(Evry_Item *it, Evas *e) } if (!(o) && (!it->icon) && file->mime && - ((!strncmp(file->mime, "image/", 6)) || + (/* (!strncmp(file->mime, "image/", 6)) || */ (!strncmp(file->mime, "video/", 6)) || (!strncmp(file->mime, "application/pdf", 15))) && (evry_file_url_get(file))) @@ -570,6 +572,18 @@ evry_util_icon_get(Evry_Item *it, Evas *e) o = _file_icon_get(it, e); if (o) return o; + if (!o && it->icon && it->icon[0] == '/') + { + o = e_icon_add(e); + e_icon_preload_set(o, 1); + + if (!e_icon_file_set(o, it->icon)) + { + evas_object_del(o); + o = NULL; + } + } + if (!o && it->icon) o = evry_icon_theme_get(it->icon, e);