summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-02-22 14:13:35 +0000
committerTom Hacohen <tom@stosb.com>2013-02-22 14:13:35 +0000
commita66f1c73f7a26c9664dcb982a87eaf0a97f8dc99 (patch)
tree98825bf7b060ba8109d08f6b56d0bed0cc032575
parent9bc0260b51c92ac53494547285663334ee6feac6 (diff)
Edje entry fit: Set the min size according to the fitting as well.
-rw-r--r--src/lib/edje/edje_calc.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index abda370eff..5fc28aba51 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -1223,53 +1223,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1223 if (ep->part->scale) 1223 if (ep->part->scale)
1224 evas_object_scale_set(ep->object, TO_DOUBLE(sc)); 1224 evas_object_scale_set(ep->object, TO_DOUBLE(sc));
1225 1225
1226 if (stl)
1227 {
1228 const char *ptxt;
1229
1230 if (evas_object_textblock_style_get(ep->object) != stl->style)
1231 evas_object_textblock_style_set(ep->object, stl->style);
1232 // FIXME: need to account for editing
1233 if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
1234 {
1235 // do nothing - should be done elsewhere
1236 }
1237 else
1238 {
1239 ptxt = evas_object_textblock_text_markup_get(ep->object);
1240 if (((!ptxt) && (text)) ||
1241 ((ptxt) && (text) && (strcmp(ptxt, text))) ||
1242 ((ptxt) && (!text)))
1243 evas_object_textblock_text_markup_set(ep->object, text);
1244 }
1245 if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y))
1246 {
1247 int mw = 0, mh = 0;
1248
1249 tw = th = 0;
1250 if (!chosen_desc->text.min_x)
1251 {
1252 eo_do(ep->object,
1253 evas_obj_size_set(params->w, params->h),
1254 evas_obj_textblock_size_formatted_get(&tw, &th));
1255 }
1256 else
1257 evas_object_textblock_size_native_get(ep->object, &tw, &th);
1258 evas_object_textblock_style_insets_get(ep->object, &ins_l,
1259 &ins_r, &ins_t, &ins_b);
1260 mw = ins_l + tw + ins_r;
1261 mh = ins_t + th + ins_b;
1262 if (minw && chosen_desc->text.min_x)
1263 {
1264 if (mw > *minw) *minw = mw;
1265 }
1266 if (minh && chosen_desc->text.min_y)
1267 {
1268 if (mh > *minh) *minh = mh;
1269 }
1270 }
1271 }
1272
1273 if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y)) 1226 if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y))
1274 { 1227 {
1275 double base_s = 1.0; 1228 double base_s = 1.0;
@@ -1348,6 +1301,53 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1348 1301
1349 } 1302 }
1350 1303
1304 if (stl)
1305 {
1306 const char *ptxt;
1307
1308 if (evas_object_textblock_style_get(ep->object) != stl->style)
1309 evas_object_textblock_style_set(ep->object, stl->style);
1310 // FIXME: need to account for editing
1311 if (ep->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
1312 {
1313 // do nothing - should be done elsewhere
1314 }
1315 else
1316 {
1317 ptxt = evas_object_textblock_text_markup_get(ep->object);
1318 if (((!ptxt) && (text)) ||
1319 ((ptxt) && (text) && (strcmp(ptxt, text))) ||
1320 ((ptxt) && (!text)))
1321 evas_object_textblock_text_markup_set(ep->object, text);
1322 }
1323 if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y))
1324 {
1325 int mw = 0, mh = 0;
1326
1327 tw = th = 0;
1328 if (!chosen_desc->text.min_x)
1329 {
1330 eo_do(ep->object,
1331 evas_obj_size_set(params->w, params->h),
1332 evas_obj_textblock_size_formatted_get(&tw, &th));
1333 }
1334 else
1335 evas_object_textblock_size_native_get(ep->object, &tw, &th);
1336 evas_object_textblock_style_insets_get(ep->object, &ins_l,
1337 &ins_r, &ins_t, &ins_b);
1338 mw = ins_l + tw + ins_r;
1339 mh = ins_t + th + ins_b;
1340 if (minw && chosen_desc->text.min_x)
1341 {
1342 if (mw > *minw) *minw = mw;
1343 }
1344 if (minh && chosen_desc->text.min_y)
1345 {
1346 if (mh > *minh) *minh = mh;
1347 }
1348 }
1349 }
1350
1351 if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y)) 1351 if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y))
1352 { 1352 {
1353 int mw = 0, mh = 0; 1353 int mw = 0, mh = 0;