diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-06-30 17:53:41 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-06-30 17:53:41 +0100 |
commit | db83497645eee549aefca3dda6e9a99fcdeabf0b (patch) | |
tree | 75c42a24cd7556f17c25df4961f0c66ce4cb9d8e /desktop | |
parent | cca6707585253c3ead2f8cc20989a8646b62d038 (diff) | |
download | netsurf-db83497645eee549aefca3dda6e9a99fcdeabf0b.tar.gz netsurf-db83497645eee549aefca3dda6e9a99fcdeabf0b.tar.bz2 |
Inform front end when treeview height changes.
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/treeview.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c index 30d0066c0..725125d9a 100644 --- a/desktop/treeview.c +++ b/desktop/treeview.c @@ -115,7 +115,6 @@ struct treeview_drag { }; /**< Drag state */ struct treeview { - uint32_t view_height; /** Viewport size */ uint32_t view_width; /** Viewport size */ struct treeview_node *root; /**< Root node */ @@ -324,6 +323,9 @@ nserror treeview_create_node_folder(struct treeview *tree, *folder = n; + /* Inform front end of change in dimensions */ + tree->cw_t->update_size(tree->cw_h, -1, tree->root->height); + return NSERROR_OK; } @@ -456,6 +458,9 @@ nserror treeview_create_node_entry(struct treeview *tree, *entry = n; + /* Inform front end of change in dimensions */ + tree->cw_t->update_size(tree->cw_h, -1, tree->root->height); + return NSERROR_OK; } @@ -500,6 +505,9 @@ nserror treeview_delete_node(struct treeview *tree, struct treeview_node *n) return NSERROR_BAD_PARAMETER; } + /* Inform front end of change in dimensions */ + tree->cw_t->update_size(tree->cw_h, -1, tree->root->height); + /* Free the node */ free(n); @@ -737,6 +745,9 @@ nserror treeview_node_expand(struct treeview *tree, node->height += additional_height; + /* Inform front end of change in dimensions */ + tree->cw_t->update_size(tree->cw_h, -1, tree->root->height); + return NSERROR_OK; } @@ -762,8 +773,7 @@ static bool treeview_node_contract_cb(struct treeview_node *node, void *ctx) do { node->height -= height_reduction; node = node->parent; - } while (node->parent != NULL && - node->parent->flags & TREE_NODE_EXPANDED); + } while (node != NULL); return false; /* Don't want to abort tree walk */ } @@ -785,6 +795,9 @@ nserror treeview_node_contract(struct treeview *tree, /* Contract node */ treeview_node_contract_cb(node, NULL); + /* Inform front end of change in dimensions */ + tree->cw_t->update_size(tree->cw_h, -1, tree->root->height); + return NSERROR_OK; } |