EAPI void elm_bg_overlay_set(Evas_Object *obj, Evas_Object *overlay) EINA_ARG_NONNULL(1);
EAPI Evas_Object *elm_bg_overlay_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
EAPI Evas_Object *elm_bg_overlay_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EAPI void elm_bg_load_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
/* smart callbacks called:
*/
Evas_Object *base, *rect, *img, *overlay;
const char *file, *group;
Elm_Bg_Option option;
+ struct {
+ Evas_Coord w, h;
+ } load_opts;
};
static const char *widtype = NULL;
if (wd->img)
{
- evas_object_del(wd->img);
- wd->img = NULL;
+ evas_object_del(wd->img);
+ wd->img = NULL;
}
if (!file)
{
eina_stringshare_replace(&wd->group, group);
if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
{
- wd->img = edje_object_add(evas_object_evas_get(wd->base));
- edje_object_file_set(wd->img, file, group);
+ wd->img = edje_object_add(evas_object_evas_get(wd->base));
+ edje_object_file_set(wd->img, file, group);
}
else
{
- wd->img = evas_object_image_add(evas_object_evas_get(wd->base));
- evas_object_image_file_set(wd->img, file, group);
+ wd->img = evas_object_image_add(evas_object_evas_get(wd->base));
+ if ((wd->load_opts.w > 0) && (wd->load_opts.h > 0))
+ evas_object_image_load_size_set(wd->img, wd->load_opts.w, wd->load_opts.h);
+ evas_object_image_file_set(wd->img, file, group);
}
evas_object_repeat_events_set(wd->img, EINA_TRUE);
edje_object_part_swallow(wd->base, "elm.swallow.background", wd->img);