diff options
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c index 3fd50d18d..80d470c7a 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; } @@ -1431,8 +1446,10 @@ void layout_float_find_dimensions(int available_width, if (margin[RIGHT] == AUTO) margin[RIGHT] = 0; - padding[RIGHT] += scrollbar_width; - padding[BOTTOM] += scrollbar_width; + if (box->gadget == NULL) { + padding[RIGHT] += scrollbar_width; + padding[BOTTOM] += scrollbar_width; + } if (box->object && !(box->flags & REPLACE_DIM) && content_get_type(box->object) != CONTENT_HTML) { |