summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-09-10 10:55:25 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2017-09-10 14:53:15 (GMT)
commit37127c4a52b6d85faef379ad6c6e07f63b1ccf46 (patch)
tree4e6dc18344855c1b20803f4fd014750a92f43179
parent43cdd742212ae0b47080717bfab028b1c78fbebc (diff)
downloadnetsurf-37127c4a52b6d85faef379ad6c6e07f63b1ccf46.tar.gz
netsurf-37127c4a52b6d85faef379ad6c6e07f63b1ccf46.tar.bz2
Treeview: Ensure window extents take account of search bar presence.
-rw-r--r--desktop/treeview.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c
index ba1056e..2779550 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -348,8 +348,12 @@ static inline void treeview__cw_update_size(
const struct treeview *tree,
int width, int height)
{
+ int search_height = (tree->flags & TREEVIEW_SEARCHABLE) ?
+ tree_g.line_height : 0;
+
if (tree->cw_t != NULL) {
- tree->cw_t->update_size(tree->cw_h, width, height);
+ tree->cw_t->update_size(tree->cw_h, width,
+ height + search_height);
}
}
@@ -4151,12 +4155,15 @@ treeview_mouse_action(treeview *tree, browser_mouse_state mouse, int x, int y)
/* Exported interface, documented in treeview.h */
int treeview_get_height(treeview *tree)
{
+ int search_height = (tree->flags & TREEVIEW_SEARCHABLE) ?
+ tree_g.line_height : 0;
+
assert(tree != NULL);
assert(tree->root != NULL);
treeview__cw_update_size(tree, -1, tree->root->height);
- return tree->root->height;
+ return tree->root->height + search_height;
}