From 5a1799c941be3589d94c69baf8c640752617a525 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 3 Sep 2006 11:32:13 +0000 Subject: [PATCH] Icons back in menus again. SVN revision: 25401 --- src/bin/e_apps.c | 6 +++--- src/bin/e_menu.c | 13 +++++++++++-- src/bin/e_menu.h | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/bin/e_apps.c b/src/bin/e_apps.c index 210d1dcda..72e1640cf 100644 --- a/src/bin/e_apps.c +++ b/src/bin/e_apps.c @@ -1609,8 +1609,7 @@ e_app_icon_add(Evas *evas, E_App *a) EAPI void e_app_icon_add_to_menu_item(E_Menu_Item *mi, E_App *a) { - if (a->icon_path) - e_menu_item_icon_file_set(mi, a->icon_path); + mi->app = a; if ((!a->icon_path) && (a->icon_class)) { char *v; @@ -1625,7 +1624,8 @@ e_app_icon_add_to_menu_item(E_Menu_Item *mi, E_App *a) /* e_menu_item_icon_edje_set() just tucks away the params, the actual call to edje_object_file_set() happens later. */ /* e_menu_item_icon_file_set() just tucks away the params, the actual call to e_icon_add() happens later. */ e_menu_item_icon_edje_set(mi, a->path, "icon"); - return; + if (a->icon_path) + e_menu_item_icon_file_set(mi, a->icon_path); } diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c index a464304cc..5bcdb9e12 100644 --- a/src/bin/e_menu.c +++ b/src/bin/e_menu.c @@ -1205,10 +1205,19 @@ _e_menu_item_realize(E_Menu_Item *mi) else evas_object_del(o); - if (mi->icon) + /* FIXME: Not sure why there are two different tries to get the icon size, surely only the last one si needed. */ + /* FIXME: Do it this way later, when e_app_icon_add() just registers a request for an icon to be filled in when it's ready. + if (mi->app) + { + o = e_app_icon_add(mi->menu->evas, mi->app); + mi->icon_object = o; + e_icon_size_get(mi->icon_object, &icon_w, &icon_h); + } + else + */ + if (mi->icon) { /* This is done this way to match up with how e_app_icon_add does it. */ -// mi->icon_object = NULL; /* Just coz I'm paranoid, may not be needed. */ if (mi->icon_key) { Evas_Coord iww, ihh; diff --git a/src/bin/e_menu.h b/src/bin/e_menu.h index 2b9484b3d..ddf6d4032 100644 --- a/src/bin/e_menu.h +++ b/src/bin/e_menu.h @@ -100,6 +100,8 @@ struct _E_Menu_Item Evas_Object *submenu_object; Evas_Object *event_object; + + E_App *app; /* For when this item is used for an app. Experimental, if this makes it into cvs, kill onefang. */ int label_w, label_h; int icon_w, icon_h;