elm notify : some fix. hoversel :add items_get()

SVN revision: 42879
This commit is contained in:
Jonathan Atton 2009-10-04 23:05:50 +00:00
parent f76f005f75
commit ba714b567c
4 changed files with 40 additions and 9 deletions

View File

@ -580,6 +580,7 @@ extern "C" {
EAPI void elm_hoversel_hover_begin(Evas_Object *obj);
EAPI void elm_hoversel_hover_end(Evas_Object *obj);
EAPI void elm_hoversel_clear(Evas_Object *obj);
EAPI const Eina_List * elm_hoversel_items_get(Evas_Object *obj);
EAPI Elm_Hoversel_Item *elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data);
EAPI void elm_hoversel_item_del(Elm_Hoversel_Item *item);
EAPI void *elm_hoversel_item_data_get(Elm_Hoversel_Item *it);

View File

@ -400,6 +400,25 @@ elm_hoversel_clear(Evas_Object *obj)
elm_hoversel_item_del(it);
}
/**
* Get the list of items.
*
* @param obj The hoversel object
* @return Returns a list of Elm_Hoversel_Item*
*
* @ingroup Hoversel
*/
EAPI const Eina_List *
elm_hoversel_items_get(Evas_Object *obj)
{
Elm_Hoversel_Item *it;
Eina_List *l, *ll;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
return wd->items;
}
/**
* Add an item to the hoversel button
*
@ -544,3 +563,4 @@ elm_hoversel_item_icon_get(Elm_Hoversel_Item *it, const char **icon_file, const
if (icon_group) *icon_group = it->icon_group;
if (icon_type) *icon_type = it->icon_type;
}

View File

@ -93,6 +93,12 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
_calc(obj);
}
static void
_content_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
_calc(data);
}
static void
_calc(Evas_Object *obj)
{
@ -110,28 +116,28 @@ _calc(Evas_Object *obj)
switch (wd->orient)
{
case ELM_NOTIFY_ORIENT_TOP:
evas_object_move(wd->notify, x + offx, 0);
evas_object_move(wd->notify, x + offx, y);
break;
case ELM_NOTIFY_ORIENT_BOTTOM:
evas_object_move(wd->notify, x + offx, h - minh);
evas_object_move(wd->notify, x + offx, y + h - minh);
break;
case ELM_NOTIFY_ORIENT_LEFT:
evas_object_move(wd->notify, 0, y + offy);
evas_object_move(wd->notify, x, y + offy);
break;
case ELM_NOTIFY_ORIENT_RIGHT:
evas_object_move(wd->notify, w - minw, y + offy);
evas_object_move(wd->notify, x + w - minw, y + offy);
break;
case ELM_NOTIFY_ORIENT_TOP_LEFT:
evas_object_move(wd->notify, 0, 0);
evas_object_move(wd->notify, x, y);
break;
case ELM_NOTIFY_ORIENT_TOP_RIGHT:
evas_object_move(wd->notify, w - minw, 0);
evas_object_move(wd->notify, x + w - minw, y);
break;
case ELM_NOTIFY_ORIENT_BOTTOM_LEFT:
evas_object_move(wd->notify, 0, h - minh);
evas_object_move(wd->notify, x, y + h - minh);
break;
case ELM_NOTIFY_ORIENT_BOTTOM_RIGHT:
evas_object_move(wd->notify, w - minw, h - minh);
evas_object_move(wd->notify, x + w - minw, y + h - minh);
break;
}
evas_object_resize(wd->notify, minw, minh);
@ -208,6 +214,7 @@ elm_notify_add(Evas_Object *parent)
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _resize, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj);
@ -238,6 +245,9 @@ elm_notify_content_set(Evas_Object *obj, Evas_Object *content)
evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
evas_object_event_callback_add(content,
EVAS_CALLBACK_RESIZE,
_content_resize, obj);
wd->content = content;
_sizing_eval(obj);
}
@ -317,3 +327,4 @@ elm_notify_timer_init(Evas_Object *obj)
if (wd->timeout>0)
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
}

View File

@ -169,7 +169,6 @@ static void _update_image_1(Evas_Object *obj)
if (!wd) return;
if(!eina_list_count(wd->img1_parts))
return;
evas_object_geometry_get(wd->slideshow, &x, &y, &w, &h);
o = edje_object_part_object_get(wd->slideshow, eina_list_data_get(wd->img1_parts));