From 0bd39eed21fc39832cec265b2915887b0e1aa6fb Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Sun, 19 Dec 2010 12:27:33 +0000 Subject: Allow tree drag status to reflect drags within textareas. svn path=/trunk/netsurf/; revision=11097 --- desktop/tree.c | 2 ++ desktop/tree.h | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/desktop/tree.c b/desktop/tree.c index 748e7b952..e436339f1 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -2136,6 +2136,7 @@ bool tree_mouse_action(struct tree *tree, browser_mouse_state mouse, int x, BROWSER_MOUSE_DRAG_2)) { /* Drag starting */ tree->textarea_drag_start = true; + tree->drag = TREE_TEXTAREA_DRAG; } else { /* Other action */ tree->textarea_drag_start = false; @@ -2533,6 +2534,7 @@ void tree_drag_end(struct tree *tree, browser_mouse_state mouse, int x0, int y0, switch (tree->drag) { case TREE_NO_DRAG: + case TREE_TEXTAREA_DRAG: case TREE_UNKNOWN_DRAG: break; case TREE_SELECT_DRAG: diff --git a/desktop/tree.h b/desktop/tree.h index 032b5e213..e5abe2102 100644 --- a/desktop/tree.h +++ b/desktop/tree.h @@ -63,6 +63,7 @@ typedef enum { TREE_NO_DRAG = 0, TREE_SELECT_DRAG, TREE_MOVE_DRAG, + TREE_TEXTAREA_DRAG, /** < A drag that is passed to a textarea */ TREE_UNKNOWN_DRAG /** < A drag the tree itself won't handle */ } tree_drag_type; @@ -134,7 +135,7 @@ struct tree *tree_create(unsigned int flags, struct node *tree_create_folder_node(struct tree *tree, struct node *parent, const char *title, bool editable, bool retain_in_memory, bool deleted); -struct node *tree_create_leaf_node(struct tree *tree, struct node *parent, +struct node *tree_create_leaf_node(struct tree *tree, struct node *parent, const char *title, bool editable, bool retain_in_memory, bool deleted); struct node_element *tree_create_node_element(struct node *parent, @@ -189,9 +190,9 @@ bool tree_mouse_action(struct tree *tree, browser_mouse_state mouse, void tree_drag_end(struct tree *tree, browser_mouse_state mouse, int x0, int y0, int x1, int y1); bool tree_keypress(struct tree *tree, uint32_t key); - -int tree_alphabetical_sort(struct node *, struct node *); + +int tree_alphabetical_sort(struct node *, struct node *); void tree_start_edit(struct tree *tree, struct node_element *element); struct hlcache_handle *tree_load_icon(const char *name); - + #endif -- cgit v1.2.3