hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4e6539725e59fce99a861566219c5b23d4f5868a

commit 4e6539725e59fce99a861566219c5b23d4f5868a
Author: Shinwoo Kim <cinoo....@samsung.com>
Date:   Mon May 13 13:09:24 2019 +0900

    Efl.Ui.Textpath: enhance to support legacy API
    
    Summary:
    The legacy API is available after https://phab.enlightenment.org/D7033 but
    internal function does not care of it. This change makes textpath work with
    the legacy style file(./data/elementary/themes/edc/elm/textpath.edc).
    
    Reviewers: Hermet, jsuya
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D8875
---
 src/lib/elementary/efl_ui_textpath.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/lib/elementary/efl_ui_textpath.c 
b/src/lib/elementary/efl_ui_textpath.c
index 2e4eff536f..593339c059 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -528,7 +528,7 @@ _textpath_ellipsis_set(Efl_Ui_Textpath_Data *pd, Eina_Bool 
enabled)
 }
 
 static void
-_ellipsis_set(Efl_Ui_Textpath_Data *pd)
+_ellipsis_set(Efl_Ui_Textpath_Data *pd, Eo *obj)
 {
    if (!pd->text_obj) return;
 
@@ -536,7 +536,11 @@ _ellipsis_set(Efl_Ui_Textpath_Data *pd)
    Eina_Bool is_ellipsis = EINA_FALSE;
    const Evas_Object *tb;
 
-   tb = edje_object_part_object_get(pd->text_obj, "efl.text");
+   if (elm_widget_is_legacy(obj))
+     tb = edje_object_part_object_get(pd->text_obj, "elm.text");
+   else
+     tb = edje_object_part_object_get(pd->text_obj, "efl.text");
+
    evas_object_textblock_size_native_get(tb, &w, &h);
    evas_object_size_hint_min_set(pd->text_obj, w, h);
    if (pd->ellipsis)
@@ -566,7 +570,7 @@ _textpath_text_set_internal(Eo *obj, Efl_Ui_Textpath_Data 
*pd, const char *part,
 
    if (!text) text = "";
    ret = edje_object_part_text_set(pd->text_obj, part, text);
-   _ellipsis_set(pd);
+   _ellipsis_set(pd, obj);
    _sizing_eval(pd);
 
    return ret;
@@ -663,7 +667,7 @@ _efl_ui_textpath_efl_ui_widget_theme_apply(Eo *obj, 
Efl_Ui_Textpath_Data *pd)
 
    elm_widget_theme_object_set(obj, pd->text_obj, "textpath", "base",
                                elm_widget_style_get(obj));
-   _ellipsis_set(pd);
+   _ellipsis_set(pd, obj);
 
    return ret;
 }
@@ -728,12 +732,12 @@ _efl_ui_textpath_slice_number_set(Eo *obj EINA_UNUSED, 
Efl_Ui_Textpath_Data *pd,
 }
 
 EOLIAN static void
-_efl_ui_textpath_ellipsis_set(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, 
Eina_Bool ellipsis)
+_efl_ui_textpath_ellipsis_set(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool 
ellipsis)
 {
    if (pd->ellipsis == ellipsis) return;
    pd->ellipsis = ellipsis;
 
-   _ellipsis_set(pd);
+   _ellipsis_set(pd, obj);
    _sizing_eval(pd);
 }
 

-- 


Reply via email to