Evas textblock: Fixed two ellipsis issues.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 7 Jun 2011 11:38:07 +0000 (11:38 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 7 Jun 2011 11:38:07 +0000 (11:38 +0000)
1. If there's no wrapping enabled, do ellipsis even if we still have vertical
room left.
2. Fixed updating of o->have_ellipsis.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@60038 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 6e97633..ead8518 100644 (file)
@@ -3562,10 +3562,13 @@ _layout_par(Ctxt *c)
                 (c->w - c->o->style_pad.l - c->o->style_pad.r -
                  c->marginl - c->marginr)) || (wrap > 0)))
           {
-             /* Handle ellipsis here */
+             /* Handle ellipsis here. If we don't have more width left
+              * and no height left, or no more width left and no wrapping. */
              if ((it->format->ellipsis == 1.0) && (c->h >= 0) &&
-                   (2 * it->h + c->y >
-                    c->h - c->o->style_pad.t - c->o->style_pad.b))
+                   ((2 * it->h + c->y >
+                     c->h - c->o->style_pad.t - c->o->style_pad.b) ||
+                    (!it->format->wrap_word && !it->format->wrap_char &&
+                     !it->format->wrap_mixed)))
                {
                   _layout_handle_ellipsis(c, it, i);
                   ret = 1;
@@ -3827,6 +3830,7 @@ _layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t,
    if (o->content_changed)
      {
         Evas_Object_Textblock_Node_Text *n;
+        c->o->have_ellipsis = 0;
         c->par = c->paragraphs = o->paragraphs;
         /* Go through all the text nodes to create the logical layout */
         EINA_INLIST_FOREACH(c->o->text_nodes, n)
@@ -4124,7 +4128,6 @@ _relayout(const Evas_Object *obj)
    Evas_Object_Textblock *o;
 
    o = (Evas_Object_Textblock *)(obj->object_data);
-   o->have_ellipsis = 0;
    _layout(obj, obj->cur.geometry.w, obj->cur.geometry.h,
          &o->formatted.w, &o->formatted.h);
    o->formatted.valid = 1;