From 762e1aad733c4d56edbb85c7b21b0951d8f759f2 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 6 Feb 2013 22:39:45 +0000 Subject: First pass at getting html forms to use textarea widget. (Input element types text & password, and textarea element.) Can edit and submit forms, but there are loads of issues. --- render/layout.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'render/layout.c') diff --git a/render/layout.c b/render/layout.c index 331e1efdb..95903a2bb 100644 --- a/render/layout.c +++ b/render/layout.c @@ -46,6 +46,7 @@ #include "content/content_protected.h" #include "desktop/options.h" #include "desktop/scrollbar.h" +#include "desktop/textarea.h" #include "render/box.h" #include "render/font.h" #include "render/form.h" @@ -650,6 +651,20 @@ bool layout_block_context(struct box *block, int viewport_height, layout_apply_minmax_height(block, NULL); } + if (block->gadget && + (block->gadget->type == GADGET_TEXTAREA || + block->gadget->type == GADGET_PASSWORD || + block->gadget->type == GADGET_TEXTBOX)) { + int ta_width = block->padding[LEFT] + block->width + + block->padding[RIGHT]; + int ta_height = block->padding[TOP] + block->height + + block->padding[BOTTOM]; + textarea_set_layout(block->gadget->data.text.ta, + ta_width, ta_height, + block->padding[TOP], block->padding[RIGHT], + block->padding[BOTTOM], block->padding[LEFT]); + } + return true; } -- cgit v1.2.3