From 08c2c6be0993391bee137c32f818ba889b1ba468 Mon Sep 17 00:00:00 2001 From: tasn Date: Tue, 29 Mar 2011 14:14:29 +0000 Subject: [PATCH] Evas textblock: Implemented vertical alignment - no way to set it yet. Implemented the code needed, but there's still no way to set it. This should be discussed. Not sure whether this should be part of the API, or should just be set in the default style. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@58185 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 1fcf5cf..cdba3d7 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -1793,7 +1793,7 @@ struct _Ctxt int line_no; int underline_extend; int have_underline, have_underline2; - double align; + double align, valign; Eina_Bool align_auto; }; @@ -3486,6 +3486,7 @@ _layout(const Evas_Object *obj, int calc_only, int w, int h, int *w_ret, int *h_ c->line_no = 0; c->align = 0.0; c->align_auto = EINA_TRUE; + c->valign = 0.0; c->ln = NULL; @@ -3688,6 +3689,19 @@ _layout(const Evas_Object *obj, int calc_only, int w, int h, int *w_ret, int *h_ if (w_ret) *w_ret = c->wmax; if (h_ret) *h_ret = c->hmax; + /* Is this really the place? */ + /* Vertically align the textblock */ + if ((c->valign > 0.0) && (c->h > c->hmax)) + { + Evas_Coord adjustment = (c->h - c->hmax) * c->valign; + Evas_Object_Textblock_Paragraph *par; + EINA_INLIST_FOREACH(c->paragraphs, par) + { + par->y += adjustment; + } + + } + if ((o->style_pad.l != style_pad_l) || (o->style_pad.r != style_pad_r) || (o->style_pad.t != style_pad_t) || (o->style_pad.b != style_pad_b)) { -- 2.7.4