diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2004-12-13 13:48:56 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2004-12-13 13:48:56 +0000 |
commit | 57fbde93e6b599af555e376ee1124fdf74b1a8a6 (patch) | |
tree | 52d988248dbfb0344716edd898ab9d5b0d37e0cc /desktop | |
parent | 9d56448775bfce329452326dfdc5a256f9c1d8e9 (diff) | |
download | netsurf-57fbde93e6b599af555e376ee1124fdf74b1a8a6.tar.gz netsurf-57fbde93e6b599af555e376ee1124fdf74b1a8a6.tar.bz2 |
[project @ 2004-12-13 13:48:56 by rjw]
Fix hotlist dragging inconsitency.
svn path=/import/netsurf/; revision=1402
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/tree.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/desktop/tree.c b/desktop/tree.c index d504ddcba..ee139e96b 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -30,6 +30,7 @@ static void tree_reset_URL_node(struct tree *tree, struct node *node); static void tree_handle_selection_area_node(struct tree *tree, struct node *node, int x, int y, int width, int height, bool invert); static void tree_selected_to_processing(struct node *node); +void tree_clear_processing(struct node *node); struct node *tree_move_processing_node(struct node *node, struct node *link, bool before, bool first); @@ -463,9 +464,12 @@ struct node_element *tree_find_element(struct node *node, int user_type) { void tree_move_selected_nodes(struct tree *tree, struct node *destination, bool before) { struct node *link; + tree_clear_processing(tree->root); tree_selected_to_processing(tree->root); - if (destination->processing) + if (destination->processing) { + tree_clear_processing(tree->root); return; + } if ((destination->folder) && (!destination->expanded) && (!before)) { destination->expanded = true; tree_handle_node_changed(tree, destination, false, true); @@ -474,6 +478,7 @@ void tree_move_selected_nodes(struct tree *tree, struct node *destination, bool while (link) link = tree_move_processing_node(tree->root, link, false, false); + tree_clear_processing(tree->root); tree_recalculate_node_positions(tree->root); tree_redraw_area(tree, 0, 0, 16384, 16384); } @@ -487,13 +492,27 @@ void tree_move_selected_nodes(struct tree *tree, struct node *destination, bool void tree_selected_to_processing(struct node *node) { for (; node; node = node->next) { node->processing = node->selected; - if (node->child) + if ((node->child) && (node->expanded)) tree_selected_to_processing(node->child); } } /** + * Clears the processing flag. + * + * \param node the node to process siblings and children of + */ +void tree_clear_processing(struct node *node) { + for (; node; node = node->next) { + node->processing = false; + if (node->child) + tree_clear_processing(node->child); + } +} + + +/** * Moves the first node in a tree with the processing flag set. * * \param tree the node to move siblings/children of |