summaryrefslogtreecommitdiff
path: root/src/bin/e_widget_toolbar.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-06-20 10:55:08 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-06-20 10:55:08 +0000
commit401482dfbfa81c242006571a99462ec615705431 (patch)
tree9b4e06d12a922c71a740807e99bae14ab43d9e1a /src/bin/e_widget_toolbar.c
parentd0868ecd950ce505c2a6cc29f4ada42db85c585a (diff)
toolbar - be happy without icon
SVN revision: 49767
Diffstat (limited to 'src/bin/e_widget_toolbar.c')
-rw-r--r--src/bin/e_widget_toolbar.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/bin/e_widget_toolbar.c b/src/bin/e_widget_toolbar.c
index d28e2ab..5b1899b 100644
--- a/src/bin/e_widget_toolbar.c
+++ b/src/bin/e_widget_toolbar.c
@@ -158,7 +158,7 @@ e_widget_toolbar_item_remove(Evas_Object *obj, int num)
158 if (it) 158 if (it)
159 { 159 {
160 evas_object_del(it->o_base); 160 evas_object_del(it->o_base);
161 evas_object_del(it->o_icon); 161 if (it->o_icon) evas_object_del(it->o_icon);
162 wd->items = eina_list_remove(wd->items, it); 162 wd->items = eina_list_remove(wd->items, it);
163 E_FREE(it); 163 E_FREE(it);
164 } 164 }
@@ -263,7 +263,7 @@ e_widget_toolbar_clear(Evas_Object *obj)
263 EINA_LIST_FREE(wd->items, it) 263 EINA_LIST_FREE(wd->items, it)
264 { 264 {
265 evas_object_del(it->o_base); 265 evas_object_del(it->o_base);
266 evas_object_del(it->o_icon); 266 if (it->o_icon) evas_object_del(it->o_icon);
267 E_FREE(it); 267 E_FREE(it);
268 } 268 }
269} 269}
@@ -296,7 +296,7 @@ _e_wid_del_hook(Evas_Object *obj)
296 EINA_LIST_FREE(wd->items, it) 296 EINA_LIST_FREE(wd->items, it)
297 { 297 {
298 evas_object_del(it->o_base); 298 evas_object_del(it->o_base);
299 evas_object_del(it->o_icon); 299 if (it->o_icon) evas_object_del(it->o_icon);
300 E_FREE(it); 300 E_FREE(it);
301 } 301 }
302 E_FREE(wd); 302 E_FREE(wd);
@@ -525,10 +525,13 @@ _item_select(Item *it)
525{ 525{
526 it->selected = EINA_TRUE; 526 it->selected = EINA_TRUE;
527 edje_object_signal_emit(it->o_base, "e,state,selected", "e"); 527 edje_object_signal_emit(it->o_base, "e,state,selected", "e");
528 if (strcmp(evas_object_type_get(it->o_icon), "e_icon")) 528 if (it->o_icon)
529 edje_object_signal_emit(it->o_icon, "e,state,selected", "e"); 529 {
530 else 530 if (strcmp(evas_object_type_get(it->o_icon), "e_icon"))
531 e_icon_selected_set(it->o_icon, EINA_TRUE); 531 edje_object_signal_emit(it->o_icon, "e,state,selected", "e");
532 else
533 e_icon_selected_set(it->o_icon, EINA_TRUE);
534 }
532 _item_show(it); 535 _item_show(it);
533 if (it->func) it->func((void *)it->data1, (void *)it->data2); 536 if (it->func) it->func((void *)it->data1, (void *)it->data2);
534} 537}
@@ -538,8 +541,11 @@ _item_unselect(Item *it)
538{ 541{
539 it->selected = EINA_FALSE; 542 it->selected = EINA_FALSE;
540 edje_object_signal_emit(it->o_base, "e,state,unselected", "e"); 543 edje_object_signal_emit(it->o_base, "e,state,unselected", "e");
541 if (strcmp(evas_object_type_get(it->o_icon), "e_icon")) 544 if (it->o_icon)
542 edje_object_signal_emit(it->o_icon, "e,state,unselected", "e"); 545 {
543 else 546 if (strcmp(evas_object_type_get(it->o_icon), "e_icon"))
544 e_icon_selected_set(it->o_icon, EINA_FALSE); 547 edje_object_signal_emit(it->o_icon, "e,state,unselected", "e");
548 else
549 e_icon_selected_set(it->o_icon, EINA_FALSE);
550 }
545} 551}