From: deasung.kim Date: Thu, 14 Jul 2011 23:56:21 +0000 (+0900) Subject: [label] bugfix using ellipsis & wrap_height_set X-Git-Tag: REL_F_I9200_20110722_1~8^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aab8d021921504a933715ed5b10ccce29ac590c6;p=framework%2Fuifw%2Felementary.git [label] bugfix using ellipsis & wrap_height_set --- diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c index fb2e40c..389e88a 100644 --- a/src/lib/elm_label.c +++ b/src/lib/elm_label.c @@ -46,23 +46,46 @@ _elm_win_recalc_job(void *data) { Widget_Data *wd = elm_widget_data_get(data); Evas_Coord minw = -1, minh = -1; - Evas_Coord resw; + Evas_Coord resw, resh; + if (!wd) return; wd->deferred_recalc_job = NULL; - evas_object_geometry_get(wd->lbl, NULL, NULL, &resw, NULL); + + evas_object_geometry_get(wd->lbl, NULL, NULL, &resw, &resh); if (wd->wrap_w > resw) - resw = wd->wrap_w; + resw = wd->wrap_w; + if (wd->wrap_h > resh) + resh = wd->wrap_h; - edje_object_size_min_restricted_calc(wd->lbl, &minw, &minh, resw, 0); - /* This is a hack to workaround the way min size hints are treated. - * If the minimum width is smaller than the restricted width, it means - * the mininmum doesn't matter. */ - if ((minw <= resw) && (minw != wd->wrap_w)) + if (wd->wrap_h == -1) /* open source routine */ + { + edje_object_size_min_restricted_calc(wd->lbl, &minw, &minh, resw, 0); + /* This is a hack to workaround the way min size hints are treated. + * If the minimum width is smaller than the restricted width, it means + * the mininmum doesn't matter. */ + if ((minw <= resw) && (minw != wd->wrap_w)) + { + Evas_Coord ominw = -1; + evas_object_size_hint_min_get(data, &ominw, NULL); + minw = ominw; + } + } + else /* ellipsis && linewrap && wrap_height_set routine */ { - Evas_Coord ominw = -1; - evas_object_size_hint_min_get(data, &ominw, NULL); - minw = ominw; + edje_object_size_min_restricted_calc(wd->lbl, &minw, &minh, 0, resh); + if ((minh <= resh) && (minh != wd->wrap_h)) + { + Evas_Coord ominh = -1; + evas_object_size_hint_min_get(data, NULL, &ominh); + minh = ominh; + } + + evas_object_geometry_get(wd->lbl, NULL, NULL, &resw, &resh); + minw = resw; + if (minh > wd->wrap_h) + minh = wd->wrap_h; } + evas_object_size_hint_min_set(data, minw, minh); evas_object_size_hint_max_set(data, wd->wrap_w, wd->wrap_h);