summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_text.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2011-02-27 18:09:03 +0000
committerTom Hacohen <tom@stosb.com>2011-02-27 18:09:03 +0000
commit7bf5ba8a7bb3368d90e5e92968f29c5279b9a12d (patch)
tree175cbca4164affc5f40e0c74870f9827dfcb6214 /legacy/edje/src/lib/edje_text.c
parent54f4d4bf2f8e1dcc40da31a3947163e0465329b4 (diff)
Edje text: Added size_range to limit the font size range.
This lets you limit the allowed sizes of the TEXT part (font sizes) to a specific range. This is especially useful in combination with the "fit" property. SVN revision: 57395
Diffstat (limited to 'legacy/edje/src/lib/edje_text.c')
-rw-r--r--legacy/edje/src/lib/edje_text.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index 655288f..ba9ecb8 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -539,9 +539,17 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
539 size = current - 1; 539 size = current - 1;
540 } 540 }
541 } 541 }
542 if (size < 1) size = 1;
543 542
544 if (!chosen_desc->text.fit_x) 543 /* Make sure the size is in range */
544 if (size < 1)
545 size = 1;
546 else if ((size > chosen_desc->text.size_range_max) &&
547 (chosen_desc->text.size_range_max > 0))
548 size = chosen_desc->text.size_range_max;
549 else if (size < chosen_desc->text.size_range_min)
550 size = chosen_desc->text.size_range_min;
551
552 /* Handle ellipsis */
545 { 553 {
546 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 554 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
547 else evas_object_text_font_source_set(ep->object, NULL); 555 else evas_object_text_font_source_set(ep->object, NULL);