forked from enlightenment/enlightenment
parent
21807cf38a
commit
f89368f089
|
@ -11,7 +11,7 @@ static void _load_modules(E_Config_Dialog_Data *cfdata);
|
|||
static int _sort_modules(void *data1, void *data2);
|
||||
static void _fill_all(E_Config_Dialog_Data *cfdata);
|
||||
static void _fill_loaded(E_Config_Dialog_Data *cfdata);
|
||||
static const char *_get_icon(Efreet_Desktop *desk);
|
||||
static char *_get_icon(Efreet_Desktop *desk);
|
||||
static E_Module *_get_module(E_Config_Dialog_Data *cfdata, const char *lbl);
|
||||
|
||||
/* Callbacks */
|
||||
|
@ -264,8 +264,13 @@ _fill_all(E_Config_Dialog_Data *cfdata)
|
|||
desk = efreet_desktop_get(buf);
|
||||
if (!desk) continue;
|
||||
icon = _get_icon(desk);
|
||||
if (icon) oc = e_util_icon_add(icon, evas);
|
||||
if (icon)
|
||||
{
|
||||
oc = e_util_icon_add(icon, evas);
|
||||
free(icon);
|
||||
}
|
||||
e_widget_ilist_append(cfdata->o_all, oc, desk->name, NULL, NULL, NULL);
|
||||
efreet_desktop_free(desk);
|
||||
}
|
||||
|
||||
/* Unfreeze ilist */
|
||||
|
@ -312,8 +317,13 @@ _fill_loaded(E_Config_Dialog_Data *cfdata)
|
|||
desk = efreet_desktop_get(buf);
|
||||
if (!desk) continue;
|
||||
icon = _get_icon(desk);
|
||||
if (icon) oc = e_util_icon_add(icon, evas);
|
||||
if (icon)
|
||||
{
|
||||
oc = e_util_icon_add(icon, evas);
|
||||
free(icon);
|
||||
}
|
||||
e_widget_ilist_append(cfdata->o_loaded, oc, desk->name, NULL, NULL, NULL);
|
||||
efreet_desktop_free(desk);
|
||||
}
|
||||
|
||||
/* Unfreeze ilist */
|
||||
|
@ -329,10 +339,10 @@ _fill_loaded(E_Config_Dialog_Data *cfdata)
|
|||
e_widget_disabled_set(cfdata->b_configure, 1);
|
||||
}
|
||||
|
||||
static const char *
|
||||
static char *
|
||||
_get_icon(Efreet_Desktop *desk)
|
||||
{
|
||||
const char *icon;
|
||||
char *icon;
|
||||
|
||||
if (!desk) return NULL;
|
||||
if (desk->icon)
|
||||
|
@ -345,7 +355,7 @@ _get_icon(Efreet_Desktop *desk)
|
|||
|
||||
path = ecore_file_dir_get(desk->orig_path);
|
||||
snprintf(buf, sizeof(buf), "%s/%s.edj", path, desk->icon);
|
||||
icon = buf;
|
||||
icon = strdup(buf);
|
||||
free(path);
|
||||
}
|
||||
return icon;
|
||||
|
@ -373,7 +383,12 @@ _get_module(E_Config_Dialog_Data *cfdata, const char *lbl)
|
|||
if (!ecore_file_exists(buf)) continue;
|
||||
desk = efreet_desktop_get(buf);
|
||||
if (!desk) continue;
|
||||
if (!strcmp(desk->name, lbl)) break;
|
||||
if (!strcmp(desk->name, lbl))
|
||||
{
|
||||
efreet_desktop_free(desk);
|
||||
break;
|
||||
}
|
||||
efreet_desktop_free(desk);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
|
|
@ -545,11 +545,12 @@ _e_int_menus_apps_scan(E_Menu *m, Efreet_Menu *menu)
|
|||
|
||||
if (entry->icon)
|
||||
{
|
||||
const char *file;
|
||||
char *file;
|
||||
|
||||
if (entry->icon[0] == '/') file = entry->icon;
|
||||
else file = efreet_icon_path_find(e_config->icon_theme, entry->icon, "24x24");
|
||||
e_menu_item_icon_file_set(mi, file);
|
||||
E_FREE(file);
|
||||
}
|
||||
if (entry->type == EFREET_MENU_ENTRY_SEPARATOR)
|
||||
e_menu_item_separator_set(mi, 1);
|
||||
|
|
|
@ -373,7 +373,7 @@ e_module_dialog_show(E_Module *m, const char *title, const char *body)
|
|||
E_Dialog *dia;
|
||||
E_Border *bd;
|
||||
char buf[PATH_MAX];
|
||||
const char *icon = NULL;
|
||||
char *icon = NULL;
|
||||
|
||||
dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_module_dialog");
|
||||
if (!dia) return;
|
||||
|
@ -393,13 +393,14 @@ e_module_dialog_show(E_Module *m, const char *title, const char *body)
|
|||
{
|
||||
snprintf(buf, sizeof(buf), "%s/%s.edj",
|
||||
e_module_dir_get(m), desktop->icon);
|
||||
icon = buf;
|
||||
icon = strdup(buf);
|
||||
}
|
||||
dia->icon_object = e_util_icon_add(icon, e_win_evas_get(dia->win));
|
||||
edje_extern_object_min_size_set(dia->icon_object, 64, 64);
|
||||
edje_object_part_swallow(dia->bg_object, "e.swallow.icon", dia->icon_object);
|
||||
evas_object_show(dia->icon_object);
|
||||
}
|
||||
if (desktop) efreet_desktop_free(desktop);
|
||||
}
|
||||
else
|
||||
e_dialog_icon_set(dia, "enlightenment/modules", 64);
|
||||
|
@ -413,6 +414,7 @@ e_module_dialog_show(E_Module *m, const char *title, const char *body)
|
|||
bd = dia->win->border;
|
||||
if (!bd) return;
|
||||
bd->internal_icon = evas_stringshare_add(icon);
|
||||
free(icon);
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
#include "e.h"
|
||||
|
||||
/* TODO: We need to free out efreet_desktop's! */
|
||||
|
||||
/* local subsystem functions */
|
||||
static void _e_order_free (E_Order *eo);
|
||||
static void _e_order_cb_monitor (void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path);
|
||||
|
|
|
@ -852,9 +852,16 @@ e_util_icon_theme_icon_add(const char *icon_name, const char *size, Evas *evas)
|
|||
if (icon_name[0] == '/') return e_util_icon_add(icon_name, evas);
|
||||
else
|
||||
{
|
||||
const char *path;
|
||||
Evas_Object *obj;
|
||||
char *path;
|
||||
|
||||
path = efreet_icon_path_find(e_config->icon_theme, icon_name, size);
|
||||
if (path) return e_util_icon_add(path, evas);
|
||||
if (path)
|
||||
{
|
||||
obj = e_util_icon_add(path, evas);
|
||||
free(path);
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -862,11 +869,11 @@ e_util_icon_theme_icon_add(const char *icon_name, const char *size, Evas *evas)
|
|||
EAPI void
|
||||
e_util_desktop_menu_item_icon_add(Efreet_Desktop *desktop, const char *size, E_Menu_Item *mi)
|
||||
{
|
||||
const char *path = NULL;
|
||||
char *path = NULL;
|
||||
|
||||
if ((!desktop) || (!desktop->icon)) return;
|
||||
|
||||
if (desktop->icon[0] == '/') path = desktop->icon;
|
||||
if (desktop->icon[0] == '/') path = strdup(desktop->icon);
|
||||
else path = efreet_icon_path_find(e_config->icon_theme, desktop->icon, size);
|
||||
|
||||
if (path)
|
||||
|
@ -883,6 +890,7 @@ e_util_desktop_menu_item_icon_add(Efreet_Desktop *desktop, const char *size, E_M
|
|||
}
|
||||
else
|
||||
e_menu_item_icon_file_set(mi, path);
|
||||
free(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
theme = l->data;
|
||||
if (theme->example_icon)
|
||||
{
|
||||
const char *path;
|
||||
char *path;
|
||||
|
||||
path = efreet_icon_path_find(theme->name.internal, theme->example_icon, "24x24");
|
||||
if (path)
|
||||
|
@ -187,6 +187,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
oc = e_icon_add(evas);
|
||||
e_icon_file_set(oc, path);
|
||||
e_icon_fill_inside_set(oc, 1);
|
||||
free(path);
|
||||
}
|
||||
}
|
||||
e_widget_ilist_append(ilist, oc, theme->name.name, NULL, NULL, theme->name.internal);
|
||||
|
@ -291,7 +292,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
theme = l->data;
|
||||
if (theme->example_icon)
|
||||
{
|
||||
const char *path;
|
||||
char *path;
|
||||
|
||||
path = efreet_icon_path_find(theme->name.internal, theme->example_icon, "24x24");
|
||||
if (path)
|
||||
|
@ -299,6 +300,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
oc = e_icon_add(evas);
|
||||
e_icon_file_set(oc, path);
|
||||
e_icon_fill_inside_set(oc, 1);
|
||||
free(path);
|
||||
}
|
||||
}
|
||||
e_widget_ilist_append(ilist, oc, theme->name.name, NULL, NULL, theme->name.internal);
|
||||
|
|
Loading…
Reference in New Issue