{
ELM_CHECK_WIDTYPE(obj, widtype);
Evas_Coord min_w = -1, min_h = -1;
-
Widget_Data *wd;
-
if ((part) && (strcmp(part, "default"))) return;
-
wd = elm_widget_data_get(obj);
if ((!wd) || (!content)) return;
+ if (content == wd->content) return;
//TODO: wd->list
if (wd->content) evas_object_del(wd->content);
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
+
elm_object_part_content_set(wd->btn, part, content);
}
if (part && strcmp(part, "video")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
-
+ if (!wd) return;
double pos, length;
Eina_Bool seekable;
if (!_elm_video_check(content)) return;
+ if (wd->video == content) return;
+ if (wd->video) evas_object_del(wd->video);
_cleanup_callback(wd);
wd->video = content;
elm_widget_can_focus_set(obj, EINA_TRUE);
elm_widget_event_hook_set(obj, _event_hook);
elm_widget_content_set_hook_set(obj, _content_set_hook);
+ /* TODO: add content_unset and content_get hook */
wd->layout = edje_object_add(e);
_elm_theme_object_set(obj, wd->layout, "player", "base", "default");
if (!wd) return;
if (wd->title_icon == icon) return;
title_visibility_old = (wd->title_text) || (wd->title_icon);
- if (wd->title_icon)
- {
- evas_object_del(wd->title_icon);
- wd->title_icon = NULL;
- }
+ if (wd->title_icon) evas_object_del(wd->title_icon);
+
wd->title_icon = icon;
title_visibility_current = (wd->title_text) || (wd->title_icon);
elm_object_part_content_set(wd->base, "elm.swallow.title.icon",
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd;
-
if (part && strcmp(part, "overlay")) return;
-
wd = elm_widget_data_get(obj);
if (!wd) return;
- if (wd->overlay)
- {
- evas_object_del(wd->overlay);
- wd->overlay = NULL;
- }
+
+ if (content == wd->overlay) return;
+ if (wd->overlay) evas_object_del(wd->overlay);
+
+ wd->overlay = content;
if (content)
{
- wd->overlay = content;
edje_object_part_swallow(wd->base, "elm.swallow.content", content);
elm_widget_sub_object_add(obj, content);
}
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *edje;
+ Evas_Object *prev_content;
if ((!wd) || (!content)) return;
if (wd->scroll)
else
edje = wd->ent;
- /* Delete the currently swallowed object */
- Evas_Object *cswallow;
-
if (!part || !strcmp(part, "icon"))
{
- cswallow = edje_object_part_swallow_get(edje, "elm.swallow.icon");
+ prev_content = edje_object_part_swallow_get(edje, "elm.swallow.icon");
edje_object_signal_emit(edje, "elm,action,show,icon", "elm");
}
else if (!strcmp(part, "end"))
{
- cswallow = edje_object_part_swallow_get(edje, "elm.swallow.end");
+ prev_content = edje_object_part_swallow_get(edje, "elm.swallow.end");
edje_object_signal_emit(edje, "elm,action,show,end", "elm");
}
else
- cswallow = edje_object_part_swallow_get(edje, part);
+ prev_content = edje_object_part_swallow_get(edje, part);
- if (cswallow) evas_object_del(cswallow);
+ if (prev_content) evas_object_del(prev_content);
evas_event_freeze(evas_object_evas_get(obj));
elm_widget_sub_object_add(obj, content);
* @param part The content part name to set (NULL for the default content)
* @param content The new content of the object
*
+ * This sets a new object to a widget as a content object. If any object was
+ * already set as a content object in the same part, previous object will be
+ * deleted automatically.
+ *
* @note Elementary objects may have many contents
*
* @ingroup General