seoz pushed a commit to branch elementary-1.11.

http://git.enlightenment.org/core/elementary.git/commit/?id=0ccd5b03066d0576145a399f188b1ee33ac8ef89

commit 0ccd5b03066d0576145a399f188b1ee33ac8ef89
Author: Youngbok Shin <[email protected]>
Date:   Mon Nov 10 14:06:32 2014 +0900

    label: Reset sd->lastw as '-1' in some elm_label APIs for ensure the 
sizing_eval.
    
    Summary:
    In some cases, elm_label doesn't calculate its min size if it is not 
resized from outside.
    It is happened when only elm_label used with elm_label_line_wrap_set API.
    The following APIs can change min size of the widget, so we can't skip the 
sizing_eval func.
    
    elm_label_line_wrap_set
    elm_label_line_width_set
    elm_object_text_set -> _elm_label_elm_layout_text_set will be called.
    
    @fix
    
    Test Plan:
    I put a change to test_notify.c for test.
    elementary_test notify
    -> click "top" button. -> You can't see elm_label without the patch.
    
    Reviewers: woohyun, tasn, seoz
    
    Reviewed By: seoz
    
    Subscribers: herdsman
    
    Differential Revision: https://phab.enlightenment.org/D1652
---
 src/bin/test_notify.c | 4 +++-
 src/lib/elm_label.c   | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/bin/test_notify.c b/src/bin/test_notify.c
index 03bf890..f5ae7cb 100644
--- a/src/bin/test_notify.c
+++ b/src/bin/test_notify.c
@@ -61,7 +61,9 @@ test_notify(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *event_in
    evas_object_show(bx);
 
    lb = elm_label_add(win);
-   elm_object_text_set(lb, "This position is the default.");
+   elm_label_line_wrap_set(lb, ELM_WRAP_MIXED);
+   elm_label_wrap_width_set(lb, ELM_SCALE_SIZE(140));
+   elm_object_text_set(lb, "This position is the default. This is multiline 
text.");
    elm_box_pack_end(bx, lb);
    evas_object_show(lb);
 
diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c
index c206b47..48b2625 100644
--- a/src/lib/elm_label.c
+++ b/src/lib/elm_label.c
@@ -332,7 +332,7 @@ _elm_label_elm_layout_text_set(Eo *obj, Elm_Label_Data *sd, 
const char *part, co
    eo_do_super(obj, MY_CLASS, int_ret = elm_obj_layout_text_set(part, label));
    if (int_ret)
      {
-        sd->lastw = 0;
+        sd->lastw = -1;
         eo_do(obj, elm_obj_layout_sizing_eval());
      }
    return int_ret;
@@ -457,6 +457,7 @@ _elm_label_line_wrap_set(Eo *obj, Elm_Label_Data *sd, 
Elm_Wrap_Type wrap)
 
    if (_stringshare_key_value_replace(&sd->format, "wrap", wrap_str, 0) == 0)
      {
+        sd->lastw = -1;
         _label_format_set(wd->resize_obj, sd->format);
         elm_layout_sizing_eval(obj);
      }
@@ -480,6 +481,7 @@ _elm_label_wrap_width_set(Eo *obj, Elm_Label_Data *sd, 
Evas_Coord w)
    if (sd->ellipsis)
      _label_format_set(wd->resize_obj, sd->format);
    sd->wrap_w = w;
+   sd->lastw = -1;
 
    elm_layout_sizing_eval(obj);
 }

-- 


Reply via email to