static int _strbuf_key_value_replace(Eina_Strbuf *srcbuf, const char *key, const char *value, int deleteflag);
static int _stringshare_key_value_replace(const char **srcstring, const char *key, const char *value, int deleteflag);
static void _label_sliding_change(Evas_Object *obj);
+static void _label_format_set(Evas_Object *obj, const char *format);
static void
_elm_recalc_job(void *data)
_elm_widget_mirrored_reload(obj);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_theme_change(obj);
- edje_object_part_text_style_user_set(wd->lbl, "elm.text", wd->format);
+ _label_format_set(wd->lbl, wd->format);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
edje_object_scale_set(wd->lbl, elm_widget_scale_get(obj) *
_elm_config->scale);
if (wd->linewrap) _sizing_eval(data);
}
+static void
+_label_format_set(Evas_Object *obj, const char *format)
+{
+ if (format)
+ edje_object_part_text_style_user_push(obj, "elm.text", format);
+ else
+ edje_object_part_text_style_user_pop(obj, "elm.text");
+}
+
static int
_get_value_in_key_string(const char *oldstring, const char *key, char **value)
{
if (item && strcmp(item, "default")) return;
if (!label) label = "";
eina_stringshare_replace(&wd->label, label);
- edje_object_part_text_style_user_set(wd->lbl, "elm.text",
- wd->format);
+ _label_format_set(wd->lbl, wd->format);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
wd->changed = 1;
_sizing_eval(obj);
_elm_theme_object_set(obj, wd->lbl, "label", "base", "default");
wd->format = eina_stringshare_add("");
wd->label = eina_stringshare_add("<br>");
- edje_object_part_text_style_user_set(wd->lbl, "elm.text",
- wd->format);
+ _label_format_set(wd->lbl, wd->format);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
elm_widget_resize_object_set(obj, wd->lbl);
if (_stringshare_key_value_replace(&wd->format,
"wrap", wrap_str, 0) == 0)
{
- edje_object_part_text_style_user_set(wd->lbl, "elm.text",
- wd->format);
+ _label_format_set(wd->lbl, wd->format);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
wd->changed = 1;
_sizing_eval(obj);
if (wd->wrap_w == w) return;
if (wd->ellipsis)
{
- edje_object_part_text_style_user_set(wd->lbl, "elm.text",
- wd->format);
+ _label_format_set(wd->lbl, wd->format);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
}
wd->wrap_w = w;
if (_stringshare_key_value_replace(&wd->format,
"ellipsis", eina_strbuf_string_get(fontbuf), removeflag) == 0)
{
- edje_object_part_text_style_user_set(wd->lbl, "elm.text",
- wd->format);
+ _label_format_set(wd->lbl, wd->format);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
wd->changed = 1;
_sizing_eval(obj);