diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-08-16 12:23:37 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-08-16 12:23:37 +0100 |
commit | 5f4c624c5b0cdc71029b794c6ece5b566070c715 (patch) | |
tree | f9da8a50d8a520b3f3f4092eeda5b087036cfffa /desktop/treeview.c | |
parent | 2dc8b641538697dba5d61617b9a22814d79ee366 (diff) | |
download | netsurf-5f4c624c5b0cdc71029b794c6ece5b566070c715.tar.gz netsurf-5f4c624c5b0cdc71029b794c6ece5b566070c715.tar.bz2 |
Slight refactor of drag end handling, for future handling of more types of drag.
Diffstat (limited to 'desktop/treeview.c')
-rw-r--r-- | desktop/treeview.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c index 4a57fb2ba..45b2d3a1b 100644 --- a/desktop/treeview.c +++ b/desktop/treeview.c @@ -1989,15 +1989,24 @@ void treeview_mouse_action(treeview *tree, assert(tree != NULL); assert(tree->root != NULL); - /* Handle selection drag end */ - if (mouse == BROWSER_MOUSE_HOVER && - tree->drag.type == TV_DRAG_SELECTION) { - treeview_commit_selection_drag(tree); - tree->drag.type = TV_DRAG_NONE; - tree->drag.start_node = NULL; - - tree->cw_t->drag_status(tree->cw_h, CORE_WINDOW_DRAG_NONE); - return; + /* Handle drag ends */ + if (mouse == BROWSER_MOUSE_HOVER) { + switch (tree->drag.type) { + case TV_DRAG_SELECTION: + treeview_commit_selection_drag(tree); + tree->drag.type = TV_DRAG_NONE; + tree->drag.start_node = NULL; + + tree->cw_t->drag_status(tree->cw_h, + CORE_WINDOW_DRAG_NONE); + return; + case TV_DRAG_MOVE: + /* TODO */ + break; + default: + /* No drag to end */ + break; + } } if (y > tree->root->height) { |