Ensure tree height is provided when treeview building is complete.
This commit is contained in:
parent
42afcf918f
commit
b9e3f7ae3d
|
@ -789,6 +789,9 @@ nserror cookie_manager_init(struct core_window_callback_table *cw_t,
|
|||
* the treeview is built. */
|
||||
cm_ctx.built = true;
|
||||
|
||||
/* Inform client of window height */
|
||||
treeview_get_height(cm_ctx.tree);
|
||||
|
||||
LOG(("Generated cookie manager data"));
|
||||
|
||||
return NSERROR_OK;
|
||||
|
|
|
@ -767,11 +767,6 @@ nserror global_history_init(struct core_window_callback_table *cw_t,
|
|||
return err;
|
||||
}
|
||||
|
||||
/* History tree is built
|
||||
* We suppress the treeview height callback on entry insertion before
|
||||
* the treeview is built. */
|
||||
gh_ctx.built = true;
|
||||
|
||||
/* Expand the "Today" folder node */
|
||||
err = treeview_node_expand(gh_ctx.tree,
|
||||
gh_ctx.folders[GH_TODAY].folder);
|
||||
|
@ -779,6 +774,14 @@ nserror global_history_init(struct core_window_callback_table *cw_t,
|
|||
return err;
|
||||
}
|
||||
|
||||
/* History tree is built
|
||||
* We suppress the treeview height callback on entry insertion before
|
||||
* the treeview is built. */
|
||||
gh_ctx.built = true;
|
||||
|
||||
/* Inform client of window height */
|
||||
treeview_get_height(gh_ctx.tree);
|
||||
|
||||
LOG(("Loaded global history"));
|
||||
|
||||
return NSERROR_OK;
|
||||
|
|
|
@ -1089,6 +1089,9 @@ nserror hotlist_init(struct core_window_callback_table *cw_t,
|
|||
* the treeview is built. */
|
||||
hl_ctx.built = true;
|
||||
|
||||
/* Inform client of window height */
|
||||
treeview_get_height(hl_ctx.tree);
|
||||
|
||||
LOG(("Loaded hotlist"));
|
||||
|
||||
return NSERROR_OK;
|
||||
|
|
|
@ -3428,6 +3428,8 @@ int treeview_get_height(treeview *tree)
|
|||
assert(tree != NULL);
|
||||
assert(tree->root != NULL);
|
||||
|
||||
tree->cw_t->update_size(tree->cw_h, -1, tree->root->height);
|
||||
|
||||
return tree->root->height;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue