summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-02-06 22:39:45 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-02-06 22:39:45 +0000
commit762e1aad733c4d56edbb85c7b21b0951d8f759f2 (patch)
tree71305c5b65e055c907be507b6242285842bea72f /render/layout.c
parent008cdb42d718ed1e1e61c9c16e6aa22bc345d202 (diff)
downloadnetsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.gz
netsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.bz2
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.
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c15
1 files changed, 15 insertions, 0 deletions
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;
}