From: Gustavo Lima Chaves Date: Thu, 26 Dec 2013 15:54:57 +0000 (-0200) Subject: Multi button entry items now support custom parts on elm_object_item_text_[gs]et... X-Git-Tag: upstream/1.20.0~7116^2~14^2~3552 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31f2530bd70db367448561826486ead7ba01a466;p=platform%2Fupstream%2Fefl.git Multi button entry items now support custom parts on elm_object_item_text_[gs]et() calls. I also removed a crazy "if (!label) return", since no other item text hook on Elementary does that and I can't find a single reason for that to be there. --- diff --git a/legacy/elementary/src/lib/elc_multibuttonentry.c b/legacy/elementary/src/lib/elc_multibuttonentry.c index 40c6750..634e016 100644 --- a/legacy/elementary/src/lib/elc_multibuttonentry.c +++ b/legacy/elementary/src/lib/elc_multibuttonentry.c @@ -539,12 +539,15 @@ _item_text_set_hook(Elm_Object_Item *it, const char *label) { Elm_Multibuttonentry_Item *item; + const char *dest_part = NULL; - if (part && strcmp(part, "default")) return; - if (!label) return; + if (!part || !strcmp(part, "elm.text")) + dest_part = "elm.btn.text"; + else + dest_part = part; item = (Elm_Multibuttonentry_Item *)it; - edje_object_part_text_escaped_set(item->button, "elm.btn.text", label); + edje_object_part_text_escaped_set(item->button, dest_part, label); _button_resize(item->base.widget, item->button, &item->rw, &item->vw); } @@ -553,10 +556,15 @@ _item_text_get_hook(const Elm_Object_Item *it, const char *part) { Elm_Multibuttonentry_Item *item; + const char *src_part = NULL; + + if (!part || !strcmp(part, "elm.text")) + src_part = "elm.btn.text"; + else + src_part = part; - if (part && strcmp(part, "default")) return NULL; item = (Elm_Multibuttonentry_Item *)it; - return edje_object_part_text_get(item->button, "elm.btn.text"); + return edje_object_part_text_get(item->button, src_part); } static Eina_Bool