When the number of item is changed, the toolbar emits the signal to theme.

The theme can be changed something according the number of item.



SVN revision: 76487
This commit is contained in:
Jaehwan Kim 2012-09-12 05:15:43 +00:00
parent 1ac12fe423
commit 4613933a34
2 changed files with 33 additions and 0 deletions

View File

@ -456,3 +456,8 @@
* Even if the top item is inserted into the naviframe. Any transition
wouldn't be launched.
2012-09-12 Jaehwan Kim
* When the number of item is changed, the toolbar emits the signal to theme.
The theme can be changed something according the number of item.

View File

@ -775,6 +775,32 @@ _item_theme_hook(Evas_Object *obj,
evas_object_size_hint_min_set(view, minw, mh);
}
static void
_inform_item_number(Evas_Object *obj)
{
ELM_TOOLBAR_DATA_GET(obj, sd);
Elm_Toolbar_Item *it;
char buf[sizeof("elm,action,click,") + 3];
static int scount = 0;
int count = 0;
EINA_INLIST_FOREACH(sd->items, it)
{
if (!it->separator) count++;
}
if (scount != count)
{
scount = count;
sprintf(buf, "elm,number,item,%d", count);
EINA_INLIST_FOREACH(sd->items, it)
{
if (!it->separator && !it->object)
edje_object_signal_emit(VIEW(it), buf, "elm");
}
}
}
static void
_sizing_eval(Evas_Object *obj)
{
@ -835,6 +861,8 @@ _sizing_eval(Evas_Object *obj)
evas_object_resize(sd->more, w, h);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
_inform_item_number(obj);
}
static Eina_Bool