summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-02-22 14:11:41 +0000
committerTom Hacohen <tom@stosb.com>2013-02-22 14:11:41 +0000
commit9bc0260b51c92ac53494547285663334ee6feac6 (patch)
tree46892a42e8635e9b20868be995b2ff95b31b9504
parent1a0ee8cb872f2af0030626bd2abd979e48f64c7c (diff)
Edje entry fit: Set the min/max sizes according to the fitting, not before.
-rw-r--r--src/lib/edje/edje_calc.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 5b1bf1d5d2..abda370eff 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -1269,34 +1269,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1269 } 1269 }
1270 } 1270 }
1271 } 1271 }
1272 if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y))
1273 {
1274 int mw = 0, mh = 0;
1275
1276 tw = th = 0;
1277 if (!chosen_desc->text.max_x)
1278 {
1279 eo_do(ep->object,
1280 evas_obj_size_set(params->w, params->h),
1281 evas_obj_textblock_size_formatted_get(&tw, &th));
1282 }
1283 else
1284 evas_object_textblock_size_native_get(ep->object, &tw, &th);
1285 evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r,
1286 &ins_t, &ins_b);
1287 mw = ins_l + tw + ins_r;
1288 mh = ins_t + th + ins_b;
1289 if (maxw && chosen_desc->text.max_x)
1290 {
1291 if (mw > *maxw) *maxw = mw;
1292 if (minw && (*maxw < *minw)) *maxw = *minw;
1293 }
1294 if (maxh && chosen_desc->text.max_y)
1295 {
1296 if (mh > *maxh) *maxh = mh;
1297 if (minh && (*maxh < *minh)) *maxh = *minh;
1298 }
1299 }
1300 1272
1301 if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y)) 1273 if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y))
1302 { 1274 {
@@ -1376,6 +1348,35 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1376 1348
1377 } 1349 }
1378 1350
1351 if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y))
1352 {
1353 int mw = 0, mh = 0;
1354
1355 tw = th = 0;
1356 if (!chosen_desc->text.max_x)
1357 {
1358 eo_do(ep->object,
1359 evas_obj_size_set(params->w, params->h),
1360 evas_obj_textblock_size_formatted_get(&tw, &th));
1361 }
1362 else
1363 evas_object_textblock_size_native_get(ep->object, &tw, &th);
1364 evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r,
1365 &ins_t, &ins_b);
1366 mw = ins_l + tw + ins_r;
1367 mh = ins_t + th + ins_b;
1368 if (maxw && chosen_desc->text.max_x)
1369 {
1370 if (mw > *maxw) *maxw = mw;
1371 if (minw && (*maxw < *minw)) *maxw = *minw;
1372 }
1373 if (maxh && chosen_desc->text.max_y)
1374 {
1375 if (mh > *maxh) *maxh = mh;
1376 if (minh && (*maxh < *minh)) *maxh = *minh;
1377 }
1378 }
1379
1379 evas_object_textblock_valign_set(ep->object, TO_DOUBLE(chosen_desc->text.align.y)); 1380 evas_object_textblock_valign_set(ep->object, TO_DOUBLE(chosen_desc->text.align.y));
1380 } 1381 }
1381} 1382}