Experimental bouncy desktops in the fm. I will move this into
e_app_icon_add when I'm happy with it. SVN revision: 25945
This commit is contained in:
parent
fe00c5f568
commit
9cc3d3a01e
|
@ -1599,24 +1599,15 @@ _e_fm2_icon_icon_set(E_Fm2_Icon *ic)
|
|||
}
|
||||
else if (!strcmp(icon, "DESKTOP"))
|
||||
{
|
||||
E_App *app;
|
||||
|
||||
if (ic->info.pseudo_link)
|
||||
snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
|
||||
/* FIXME FIXME FIXME: e_app_new() is SLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW. it can
|
||||
* be a complete hog. this destroys performance in fm2. :(:(:(
|
||||
*/
|
||||
app = e_app_new(buf, 0);
|
||||
if (app)
|
||||
{
|
||||
/* FIXME: Actually, I think it's the icon searching that is slowing things down a lot.
|
||||
* That will be fixed by moving it to thumbnailing as planned. Commented out for now.
|
||||
*/
|
||||
// ic->obj_icon = e_app_icon_add(evas_object_evas_get(ic->sd->obj), app);
|
||||
e_object_unref(E_OBJECT(app));
|
||||
}
|
||||
ic->obj_icon = e_thumb_icon_add(evas_object_evas_get(ic->sd->obj));
|
||||
e_thumb_icon_file_set(ic->obj_icon, buf, e_config->icon_theme);
|
||||
e_thumb_icon_size_set(ic->obj_icon, 128, 128);
|
||||
evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", _e_fm2_cb_icon_thumb_gen, ic);
|
||||
_e_fm2_icon_thumb(ic);
|
||||
}
|
||||
else if (!strncmp(icon, "e/icons/fileman/mime/", 21))
|
||||
{
|
||||
|
@ -1697,24 +1688,21 @@ _e_fm2_icon_icon_set(E_Fm2_Icon *ic)
|
|||
(e_util_glob_case_match(ic->info.file, "*.desktop"))
|
||||
)
|
||||
{
|
||||
E_App *app;
|
||||
|
||||
if (ic->info.pseudo_link)
|
||||
snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
|
||||
/* FIXME FIXME FIXME: e_app_new() is SLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW. it can
|
||||
* be a complete hog. this destroys performance in fm2. :(:(:(
|
||||
*/
|
||||
app = e_app_new(buf, 0);
|
||||
if (app)
|
||||
{
|
||||
/* FIXME: Actually, I think it's the icon searching that is slowing things down a lot.
|
||||
* That will be fixed by moving it to thumbnailing as planned. Commented out for now.
|
||||
*/
|
||||
// ic->obj_icon = e_app_icon_add(evas_object_evas_get(ic->sd->obj), app);
|
||||
e_object_unref(E_OBJECT(app));
|
||||
}
|
||||
|
||||
ic->obj_icon = e_thumb_icon_add(evas_object_evas_get(ic->sd->obj));
|
||||
// FIXME: Dunno if key_hint is useful here, no one seems to use it.
|
||||
// if (ic->sd->config->icon.key_hint)
|
||||
// e_thumb_icon_file_set(ic->obj_icon, buf, ic->sd->config->icon.key_hint);
|
||||
// else
|
||||
e_thumb_icon_file_set(ic->obj_icon, buf, e_config->icon_theme);
|
||||
e_thumb_icon_size_set(ic->obj_icon, 128, 96);
|
||||
evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", _e_fm2_cb_icon_thumb_gen, ic);
|
||||
_e_fm2_icon_thumb(ic);
|
||||
|
||||
edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon);
|
||||
evas_object_show(ic->obj_icon);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <Ecore_Evas.h>
|
||||
#include <Ecore_Ipc.h>
|
||||
#include <Ecore_File.h>
|
||||
#include <Ecore_Desktop.h>
|
||||
#include <Evas.h>
|
||||
#include <Eet.h>
|
||||
#include <Edje.h>
|
||||
|
@ -44,6 +45,7 @@ static char _thumbdir[4096] = "";
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char buf[4096];
|
||||
int i;
|
||||
|
||||
/* FIXME: make this configurable */
|
||||
|
@ -71,6 +73,13 @@ main(int argc, char **argv)
|
|||
ecore_file_init();
|
||||
ecore_ipc_init();
|
||||
|
||||
ecore_desktop_init();
|
||||
ecore_desktop_paths_extras_clear();
|
||||
ecore_desktop_paths_prepend_user(ECORE_DESKTOP_PATHS_ICONS, "~/.e/e/icons");
|
||||
// snprintf(buf, sizeof(buf), "%s/data/icons", e_prefix_data_get());
|
||||
ecore_desktop_paths_append_system(ECORE_DESKTOP_PATHS_ICONS, buf);
|
||||
ecore_desktop_paths_regen();
|
||||
|
||||
snprintf(_thumbdir, sizeof(_thumbdir), "%s/.e/e/fileman/thumbnails",
|
||||
getenv("HOME"));
|
||||
ecore_file_mkpath(_thumbdir);
|
||||
|
@ -82,6 +91,8 @@ main(int argc, char **argv)
|
|||
ecore_ipc_server_del(_e_ipc_server);
|
||||
_e_ipc_server = NULL;
|
||||
}
|
||||
|
||||
ecore_desktop_shutdown();
|
||||
ecore_ipc_shutdown();
|
||||
ecore_file_shutdown();
|
||||
ecore_evas_shutdown();
|
||||
|
@ -324,6 +335,40 @@ _e_thumb_generate(E_Thumb *eth)
|
|||
hh = 0;
|
||||
alpha = 1;
|
||||
ext = strrchr(eth->file, '.');
|
||||
|
||||
if ((ext) && (!strcasecmp(ext, ".desktop")))
|
||||
{
|
||||
Ecore_Desktop *desktop;
|
||||
|
||||
desktop = ecore_desktop_get(eth->file, NULL);
|
||||
free(eth->file);
|
||||
eth->file = NULL;
|
||||
if (desktop)
|
||||
{
|
||||
if (desktop->icon_path)
|
||||
eth->file = strdup(desktop->icon_path);
|
||||
else
|
||||
eth->file = (char *)ecore_desktop_icon_find(desktop->icon_class, NULL, eth->key);
|
||||
free(eth->key);
|
||||
eth->key = NULL;
|
||||
if (eth->file)
|
||||
{
|
||||
ext = strrchr(eth->file, '.');
|
||||
if ((ext) &&
|
||||
((!strcasecmp(ext, ".edj")) ||
|
||||
(!strcasecmp(ext, ".eap")))
|
||||
)
|
||||
{
|
||||
eth->key = strdup("icon");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((ext) && (eth->key) &&
|
||||
((!strcasecmp(ext, ".edj")) ||
|
||||
(!strcasecmp(ext, ".eap")))
|
||||
|
|
Loading…
Reference in New Issue